Url Rebasing in ASP.NET 2.0
page 3 of 3
by Suresh Kumar Goudampally
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 22570/ 49


This article mainly describes the newly emerged concept Url Rebasing in ASP.NET 2.0, and what is relative path and its impact when used in masterpage. This article also quotes some examples to explain the real time issues and how URL rebasing resolves this loophole we face using relative paths in masterpages. We have also summarized Url Rebasing tips in a nut shell.






View Entire Article

User Comments

Title: A very apt and to-the-point article for the topic   
Name: Hardik Shah [Guru]
Date: 2010-03-14 4:50:27 AM
Good one ... !!! It surely sufficed.
Title: Resolve URL page method ?   
Name: Umar
Date: 2009-08-04 10:12:33 AM
They way you handle the URL issues is good but its old style that was adopted in 1.1 or before it. Now we have a page method "ResolveURL" which converts the relative path to absolute path.
Title: Good Practice   
Name: TrongKha
Date: 2009-07-31 6:03:36 PM
This is the good practice to solve link resource issues when you develop an ASP.NET application. You will not run into any problem even you decide to move (*.aspx) to different subfolders.

basePath = Request.ApplicationPath;
basePath = Page.ResolveUrl("/~");

(*.aspx) uses "~/folder/filename" for:
head runat="server"
asp:image ...
asp:hyperlink ...
Title: Mr   
Name: Thanigainathan
Date: 2009-07-31 8:36:45 AM
Very nice article. Will be helpful in practical scenarios.

Title: stylesheet trick   
Name: shaun
Date: 2009-07-30 4:45:47 AM
the trick to rebase the stylsheet is totally unneccessary.
the 'HEAD' section of the masterpage should have the 'runat=server' attribute and anything in the head section will be processed at the server, so just use the '~' in the stylesheet path to denote the root of your site.
Title: good one   
Name: vinny
Date: 2009-07-13 11:40:47 AM
Thank you Suresh
Title: Programmer   
Name: Cyril Gupta
Date: 2009-06-13 8:27:00 PM
Well, I simply use the '~' facility in my projects and though I don't identify it as rebasing or anything similar, it works wonderfully. Thanks for the article.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-06-24 10:08:23 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search