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.0Link one ascx control to anotherLink one ascx control to another
Previous
 
Next
New Post
3/17/2008 3:32 PM
 

I am having difficulty loading an ascx control based on a users click event.  Essentially what I want is a grid view displayed with a select link to a details view which would be a different ascx control then in the details the user would do the editing.  The kicker is I need all the real estate on the grid view page, which is why I need to go to another control and not display it in the same page.  I have done this sort of thing with a data list using the templates within the same control but want the ease of not having to program the sort functionality with a grid view.  I have a tight deadline to get this project out and coming up on the date!  Maybe there is a better or easier way if anyone knows, please pass it my way!


View Brenden Kehren's profile on LinkedIn
 
New Post
3/17/2008 3:47 PM
 

go to the Host-Module Definitions screen and define a Control for your details ascx control. Then when the user clicks on a select link, use the EditURL() function to display the details view. In the details view use the NavigateURL() function to go back to the grid view.

Here's an example:

Let's say you have 2 controls defined for your module, the default view (no key) is setup to display the grid view, and you have a second control defined, named "Details View" with a key of "Details".

Now, when the user clicks on the select link, you would execute something like this...

Response.Redirect(EditUrl("ItemID", SelectedValue.ToString(), "Details"))

of course, you'd have to figure out the ItemID to pass (second parameter), but that code will replace your grid view in your module with the Details View, passing ItemID to the ascx file as part of the Params collection.

In your details ascx file, get the item id like this..

If Not (Request.Params("ItemId") Is Nothing) Then
  itemId = Int32.Parse(Request.Params("ItemId"))
End If

and finally, in your details ascx file, to return to the grid view, execute the following code...

Response.Redirect(NavigateURL(), True)

 
New Post
3/17/2008 4:05 PM
 

Steve - thanks for the quick reply!  So far what I have been doing is creating the ascx controls and navigating to them via an aspx page I put in a seperate folder on my site.  Is there a way to do this outside of DNN and have it still work within DNN?


View Brenden Kehren's profile on LinkedIn
 
New Post
3/17/2008 4:08 PM
 

there's always "ways" to do almost anything :)  but if you're writing the code and not trying to shoehorn an existing application into the DNN framework, I would highly suggest do it the 'preferred' way of using module controls and the EditURL() / NavigateURL() methods.

 
New Post
3/17/2008 4:19 PM
 

Thanks!  Just trying your suggested method now!


View Brenden Kehren's profile on LinkedIn
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Link one ascx control to anotherLink one ascx control to another


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