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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Help with EditUrlHelp with EditUrl
Previous
 
Next
New Post
5/9/2007 4:54 AM
 

Hello !

I am using the EditUrl to link to another usercontrol and that is working ok, but the user control is opened with the default skin and default container (defined for site), but i need it to open the control with the current page skin and container .... Can you please help ?

Rosorio

 
New Post
5/9/2007 7:41 AM
 

As you have noticed, the current implementation of DotNetNuke uses the "admin" skin when loading a control using the syntax http://mydomain.com/default.aspx?tabid=1&ctl=MyControlKey&mid=123 (http://mydomain.com/tabid/1/ctl/MyControlKey/mid/123/default.aspx is the friendly URL).  To get around this you will have to create your own dispatch control to handle loading and unloading the appropriate child controls.  Essentially this method uses the same technique as used by the DNN core:

  1. Use LoadControl(MyUserControl.ascx) to instantiate a new control for the page you want loaded
  2. Set the ModuleConfiguration property for the new control equal to the ModuleConfiguration for the dispatch control
  3. Add the new control to you dispatch controls controls collection (or optionally use the controls collection of a placeholder control on the dispatch control)

Below is an example of some code I use for the Marketplace Product Listing module (NOTE:  I have some extra code to handle setting properties on the child control as well as hooking up event handlers for events raised from the child control.  You may or may not need these extra bits, but they are included here to show that you have lots of options when loading your own controls)

Protected Sub LoadVendorForm()
    ResetEditForm()
    Dim vendorControl As MarketplaceEditModuleBase = CType(LoadControl(c_VendorControl), MarketplaceEditModuleBase)
    vendorControl.ID =  "VendorEdit" 

    If vendorControl IsNot Nothing Then
        vendorControl.IsControlPostback = IsSubFormPostback
        vendorControl.IsAdminView = IsAdmin
        vendorControl.WorkItemID = WorkItemID

        If
IsAdmin Then
            vendorControl.VendorID = VendorID
        Else
            vendorControl.VendorID = Vendor.StagingDistributorID
        End If 

        ' We want the child control to inherit all configuration information, the same as any other control statically placed on the page
        vendorControl.ModuleConfiguration = Me.ModuleConfiguration
        EditPanel.Controls.Add(vendorControl)

        AddHandler vendorControl.FormPosted, AddressOf FormPosted
        AddHandler vendorControl.FormApproved, AddressOf FormApproved

        FormControlID = vendorControl.ClientID
    End If
End Sub 


Joe Brinkman
DNN Corp.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Help with EditUrlHelp with EditUrl


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