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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Create an Edit Page using querystring valuesCreate an Edit Page using querystring values
Previous
 
Next
New Post
5/6/2009 1:17 PM
 

I'm in the process of porting an existing application to a DotNetNuke v4.9 module.  In a nutshell the application lists news items and allows administrators to edit/delete items within a list.  So for example when an administrator logs into the system each news item displays a button underneath each item that allow an amdin to edit/delete that news item (among other things).

The application used one aspx file with a placeholder that would assign user controls to that placeholder depending upon what querystring values were found (ex. mode=view -> view.ascx, mode=edit -> edit.ascx, mode=delete -> delete.ascx, etc).  So far I created a new module, created a basic data layer and have ported over what was the default.aspx page into a default user control called viewnews.ascx.  This user control basically does what the old default.aspx did by assigning the usercontrols to the placeholder depending upon what querystring values are present.

The problem I'm running into is how to deal with the edit.ascx pages.  When an admin tries to edit a news item the edit news user control is loaded within the same module user control.  Is there anyway to force dotnetnuke to load a new page and then temporarily embed the news list module on the page for editing?

 

 
New Post
5/6/2009 2:03 PM
 

Try and stop thinking like an aspx developer :) and start thinking like a DotNetNuke developer

A DotNetNuke module is made up of one or more 'controls'.  Each control has a 'key'.  The default control (usually the 'View' mode) has a blank key. To direct a user to the edit control for a specific data item, create a new ascx control and in the module definition page create a new 'control' give it a key, for example 'Edit, and then tell it where your .ascx file is that you want to associate with that control key'. To display your new control, you would use the NavigateURL() method which takes some parameters like which control key to display and any data you want to pass to the control. 

It sounds complicated, but once you understand the 'control' concept, it saves you a lot of work and makes it easy to write modules with multiple 'views', or as DotNetNuke refers to them, 'controls'.

Start by looking at the code for a simple core module like Links which has a display control and an edit control. Look at the Module Definition and see how the controls are defined. Then look at the code behind and see how the link is crafted to take the user to the edit control.

If you are still unsure after looking at the Links module, let me know and I can post some sample code and screen shots to step you through it.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Create an Edit Page using querystring valuesCreate an Edit Page using querystring values


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