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.0Redirect to another pageRedirect to another page
Previous
 
Next
New Post
8/13/2007 4:00 AM
 

How can I redirect to another DNN page by it's name, not by TabId?

All what I found is NavigateUrl function and it has TabId as parameter.

 
New Post
8/13/2007 4:58 AM
 

you can first get the tabid using the DotNetNuke.Entities.Tabs.TabController.GetTabByName function


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
8/13/2007 8:20 AM
 

Thanks!

I found GetTabByTabPath function. It works, but I get very srange problem.

I have a simple form and a button on it, clicking on the button my page should be redirected to another tab.
When I click on the button first time, GetTabByTabPath always return -1.
It find my tab only after second click.
After researching I found that 
GetTabPathDictionary() which is called inside GetTabByTabPath() is empty for first click.
Any ideas?

 
New Post
8/13/2007 12:23 PM
 

excuse me, but i didn't understand as well, so, could someone please give specific information about how to do it... An example would be excelent.

Thanks and i'm certantly waiting for an answer

 
New Post
8/14/2007 1:54 AM
 

Ok, it's a code.
I have a simple control with the following button:

<asp:Button ID="btnCancel" runat="server" Resourcekey="Cancel" OnClick="Cancel_Click" />

It's Cancel_Click function.
 
protected void Cancel_Click(object sender, EventArgs e)
{
     Utils.RedirectToTab("//BusinessUnitEdit", "EditId=" + EditId);
}

It's RedirectToTab function

public static void RedirectToTab(string tabpath, string query)
{
 int tabid = DotNetNuke.Entities.Tabs.TabController.GetTabByTabPath(0, tabpath);
 if (tabid != -1)
 {
 string navurl = DotNetNuke.Common.Globals.NavigateURL(tabid, "", query);
 HttpContext.Current.Response.Redirect(navurl);
 }
}

By some reason GetTabByTabPath() function return -1 when I click on the button first time, so redirect
doesn't occures. When I click on the button second time function works well.

As far as I can see from DNN sources GetTabByTabPath() call GetTabPathDictionary() function.
It's a public function, so I tried to call it in my RedirectToTab() by the following way:

public static void RedirectToTab(string tabpath, string query)
{
  Dictionary<string, int> TabPath = DotNetNuke.Entities.Tabs.TabController.GetTabPathDictionary();

  int tabid = DotNetNuke.Entities.Tabs.TabController.GetTabByTabPath(0, tabpath);
  if (tabid != -1)
  {
      string navurl = DotNetNuke.Common.Globals.NavigateURL(tabid, "", query);
      HttpContext.Current.Response.Redirect(navurl);
   }
 }

I get an expected result, when I click on the button first time GetTabPathDictionary() return empty Dictionary.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Redirect to another pageRedirect to another page


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