In my previous project, the application have 3 VIEW screens (the first page is add/update, 2nd page is confirmation page, 3rd page is success or fail error message page). I need to register 3 pages in the module defination and use Globals.NavigateURL to access those pages.
For instance, my 2nd Page call ConfirmationPage.acsx (i m registered the name as “Confirm” in Module defination)
My NavigateURL code will be Globals.NavigateURL(TabId, “Confirm”, “Mid=” + moduleId.tostring(), etc parameters);
In my current project, I m have 3 screens too, this time I create a frame called “Main.ascx”, My 2nd page let name it as “second.ascx” and the 3rd page we call it “third.ascx”, I m ONLY registered Main.ascx in module defination.
Create a “PlaceHolder” name it as phMain in Main.ascx page
in Main.ascx page load,
PortalModuleBase objPortalModuleBase = (PortalModuleBase)this.LoadControl("second.ascx");
objPortalModuleBase.ModuleConfiguration = this.ModuleConfiguration;
objPortalModuleBase.ID = System.IO.Path.GetFileNameWithoutExtension(m_controlToLoad);
phMain.Controls.Add(objPortalModuleBase);
Run your applications,
Your Main.ascx will load “second.ascx” in the page.
If you have a button in “second.ascx” navigate to “third.ascx”, in the Button Event put the code below,
Response.Redirect(Globals.NavigateURL(
TabId
, ""
, "ModuleID"
, ModuleId.ToString()
, "mctl"
, "third"
));
Do you see the different between these two examples?
In first example, we pass “MID” instead of “ModuleID”, also the 2nd parameter we put the page we want to navigate.
In second example, do you notice the “mctl”? It can be used when you create a frame to load the control dynamically.