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.0Multiple View control typesMultiple View control types
Previous
 
Next
New Post
1/4/2007 11:31 AM
 

Is there a way to display multiple view controls types within a module? My problem is that when you navigate to a edit control type DNN hides the left,right,top and bottom panes. I want the module to display different views but keep the panes visible.

 

Thanks

 
New Post
1/4/2007 1:15 PM
 
Hello there,

I had the same problem as you.  If you look at this post, they offer a solution to your problem.  I did implement this solution and I can now navigate to different views with the same skin.

http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/110/threadid/46342/threadpage/2/scope/posts/Default.aspx
 
New Post
1/4/2007 2:26 PM
 

Thanks very much for the post.

Which solution did you use in that post for your module?

Thanks again

 
New Post
1/5/2007 8:20 AM
 
Hello again,

Here's the quote from the thread I sent you

Linguinut
http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/110/threadid/46342/threadpage/2/scope/posts/Default.aspx

After reviewing the way Scott McCulloch did the NewsArticles, I was able to recreate the handling of multiple view controls.  It is quite simple really.

1.  Create a default holding control (primary view control for the module).  This control will be used for all of the switching of view controls.  It has only one server control on it:

<code>
<asp:PlaceHolder id="plhControls" runat="Server" />
</code>

2.  Send a querysting variable to the tab to specify which view control to load.  Use the following code to reference the desired control:

<code>
Private m_controlToLoad As String

Private Sub ReadQueryString()
    If Not (Request("ControlType") Is Nothing) Then
        Select Case Request("ControlType").ToLower()
            Case "sales"
                m_controlToLoad = "SalesSummary.ascx"
            Case "orders"
                m_controlToLoad = "OrdersSummary.ascx"
            Case Else
                m_controlToLoad = "SalesSummary.ascx"
        End Select
    Else
        m_controlToLoad = "SalesSummary.ascx"
    End If
End Sub
</code>

3.  Load the control through code, as follows:

<code>
Private Sub LoadControlType()
     Dim objPortalModuleBase As PortalModuleBase = CType(Me.LoadControl(m_controlToLoad), PortalModuleBase)
     If Not (objPortalModuleBase Is Nothing) Then
          objPortalModuleBase.ModuleConfiguration = Me.ModuleConfiguration
          objPortalModuleBase.ID = System.IO.Path.GetFileNameWithoutExtension(m_controlToLoad)
          plhControls.Controls.Add(objPortalModuleBase)
     End If
End Sub
</code>

4.  Fire these two routines each time the page initializes:

<code>
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
     'CODEGEN: This method call is required by the Web Form Designer
     'Do not modify it using the code editor.
     InitializeComponent()
     ReadQueryString()
     LoadControlType()
End Sub
</code>

5.  In order to switch to another control, place this code in the desired event:

<code>
Response.Redirect(NavigateURL() + "&ControlType=orders")
</code>

Ahhh...now I have freedom to add as many view controls within a module as I need.  Scott, thank you very much for pointing out the way.

Vielen Dank!!
Ling


Hope this helps!
 
New Post
1/5/2007 12:27 PM
 

I got the different view control types to load but now the button click events on them do not response. I think its just posting back and resetting its self back to the main view control. Is there a way I can get the button click events to response?

Thanks

Joe

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Multiple View control typesMultiple View control types


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