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.0EditUrl loading all modulesEditUrl loading all modules
Previous
 
Next
New Post
1/14/2008 10:05 PM
 

Greetings once again!

I was surprised to see that when my module navigates the browser using EditUrl() to get the path to the module's edit view, the resulting page not only loads the edit view control for the module, but it also triggers the page_load events of all the other modules that belong to that page.

For example, using EditUrl(), the browser navigates to /Default.aspx?TabId=55&ctl=Edit&mid=397

First, the Page_Load method for the edit control of the module with id 397 executes, as expected. But then the Page_Load method for all the other modules that belong to tab 55 also execute! This I did not expect.

So my questions are:

1. Is this the expected behavior when you have ctl=Edit&mid=XXX passed to Default.aspx?

2. If so, what purpose does it serve loading up all the modules that are not visible when you have one module's edit control loaded?

3. Also, if this is the expected behavior, then is there an easy way to detect that the page is loading the edit mode of another module, and not your module, so that you can prevent a module from running all of its code when it's not going to be shown?

 

 

 
New Post
1/15/2008 7:59 PM
 

I'll have to assume that you're using LinkButton or other postback controls in this case. If that's the case, then it probably happened during the postback (which of course triggers all modules Page_Load method. After that, you redirect the response to the url you got from EditUrl.

If you want to avoid this problem, you might want to use hyperlink instead of linkbutton, and set the link to the url from EditUrl. That way user can directly go to the edit url without having to postback to the current page/module.

I hope it helps, I'm not sure though

 
New Post
1/16/2008 9:23 AM
 

I'm not sure if that will work, but I will give it a try. The EditUrl redirect response is generated from an action I have defined using the IActionable interface. It looks like this:

        public ModuleActionCollection ModuleActions
        {
            get
            {
                ModuleActionCollection actions = new ModuleActionCollection();
                actions.Add(GetNextActionID(), "Configuration", ModuleActionType.AddContent, "", "", EditUrl(), false, SecurityAccessLevel.Edit, true, false);
                return actions;
            }
        }

The execution of the Page_Load methods for all of the modules is taking place AFTER the redirect, not during the post-back.

Any ideas?

Thanks Ferry!

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0EditUrl loading all modulesEditUrl loading all modules


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