Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Hanlding several View and Edit controls within one moduleHanlding several View and Edit controls within one module
Previous
 
Next
New Post
10/14/2009 7:27 PM
 

Hi All,

Well, I have got through "first blood" of getting my DNN test site and module created using DNN 5.1.4 Starter Kit. There were some DNN "glitches" on that way, and some my misusings/misunderstadnings but one can finally get through this first learning curve of custom DNN modules development and deployment, as I have just done...

The next thing I wanted to do is to find out how to handle several View and Edit controls within my module? - I know how to add them to my module sources, and definition. I think I can use Module settings to statically (on module settings editing on a page) define/parameterize which View and Edit controls of my module to use for a certain page. I think I can manage that settings/parameters static assigment (it's rather clear from code.)

But how can I load/render this or that Module control on runtime (depending on one or another Module settting/parameter value)?

Please advise by giving a code snipped here or please point me to DNN sources' module code where this technique of dynamic loading of different controls of a Module is used.

Thank you.

--Shamil

 
New Post
10/14/2009 8:49 PM
 

OK,  I have got some clues on subject question looking through Scheduler's module Edit and History hyperlink buttons:

Edit:
                <asp:HyperLink
                   ID="editLink"
                   NavigateUrl='<%# EditURL("ScheduleID",DataBinder.Eval(Container.DataItem,"ScheduleID").ToString()) %>'
                   Visible="<%# IsEditable %>"
                   runat="server">
                <asp:Image
                   ID="editLinkImage"
                   ImageUrl="~/images/edit.gif"
                   Visible="<%# IsEditable %>"
                   AlternateText="Edit"
                   runat="server"
                   resourcekey="Edit" />
                </asp:HyperLink>

History:

            <asp:HyperLink
                    CssClass="CommandButton"
                    ID="lnkHistory"
                    resourcekey="lnkHistory"
                    NavigateUrl='<%# EditURL("ScheduleID", DataBinder.Eval(Container.DataItem,"ScheduleID").ToString(), "History") %>'
                    runat="server">History</asp:HyperLink>
 

The answer is EditUrl(...) method from DNN's ModuleInstanceContext class:


Public Class ModuleInstanceContext
        Public Function EditUrl() As String '
        Public Function EditUrl(ByVal ControlKey As String) As String
        Public Function EditUrl(ByVal KeyName As String, ByVal KeyValue As String) As String
        Public Function EditUrl(ByVal KeyName As String, ByVal KeyValue As String, ByVal ControlKey As String) As String
        Public Function EditUrl(ByVal KeyName As String, ByVal KeyValue As String, ByVal ControlKey As String, ByVal ParamArray AdditionalParameters As String()) As String
...

The ControlKey parameter defines Key value from Module Controls' definition of a control to be called/loaded.

Still open question here - is that EditUrl(...) method the only one to load different controls of a module?

I also thought that if "Supports Partial Rendering" checked then loading controls should be performed AJAX-way - but it doesn't look like it works that way...

Thank you.

--Shamil

 

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Hanlding several View and Edit controls within one moduleHanlding several View and Edit controls within one module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out