Reputation: 41
I am trying to do URL Rewriting from Global.ascx file but every time it redirects to Default.aspx page and ignores the Tab id as i am doing it in DotNetNuke ver. 06.01.03 (108). Here is the code:
if (CurrentURL_Path.Contains("scientific-cameras"))
{
HttpContext.Current.RewritePath("~/Default.aspx?TabId=105");
}
I have created a page abc.aspx
I want that if "scientific-cameras" is contains in the url then it redirect to the page (abc.aspx) and 105 is TabId for abc.aspx.
Upvotes: 4
Views: 1769
Reputation: 21
Use Routed Table URL Routing with ASP.NET 4.0 http://www.codeproject.com/Articles/77199/URL-Routing-with-ASP-NET-4-0
Upvotes: 2
Reputation: 63126
More than likely this is a conflict with the DNN stuff. There is already a friendly URL structure in DNN. I would recommend using this rather than doing your own, as you don't want too many cooks in the kitchen.
You can specify custom URL's in "Host" -> "Host Settings" -> "Friendly URL Settings".
Upvotes: 0