tags:

views:

86

answers:

2

We want to show only the base url (www.myapplication.com) of the web application even if the use browse to any other webpage in the application. Please guide.

Thanks in advance.

+1  A: 

Have you tried using Server.Transfer("~/MyHiddenPage.aspx")?

By doing a Server.Transfer, you can redirect the user to the new page without affecting the Address Bar.

rockinthesixstring
is there any trade-off if we use this approach ?
HotTester
Trade Off? here's some good info on it. http://www.developer.com/net/asp/article.php/3299641/ServerTransfer-Vs-ResponseRedirect.htm
rockinthesixstring
The main trade-offs I can think of are around usability and SEO - if all the users sees in the browser is the root URL, that's all they can bookmark, send to others, link to, etc, and search engines will have difficulty in serving results from your site as the URL of all the pages could potentially be the same, resulting in just one page appearing in the listings, with whatever content was on the last indexed page.
Zhaph - Ben Duguid
He did call it a web application, I'm *ASS*uming that it's a project similar to a desktop app... IE: not necessarily search engine public.
rockinthesixstring
The usability point might still stand though - however I try not to make assumptions for that very reason ;)
Zhaph - Ben Duguid
+1  A: 

You can do it using an IFrame only as your index page inside which all your application pages open. This way on the index you will have an IFrame showing your default page and links in them which in turn open inside the IFrame without affecting the url in the browser address bar.

Example for the above using framesets:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"&gt;
<html>
<head><title>Test</title>
</head>
<frameset cols="100%">
<frame src="http://www.geektantra.com"&gt;
</frameset>
</html>

Now whenever you click on any link inside the page the address bar url remains the same but he content changes. It is a pure HTML methodology and agnostic of any backend scripting language. So instead of http://www.geektantra.com you can put you defaul.aspx.

GeekTantra
how can we target the page to the IFrame in asp.net.. plz guide or provide a link...
HotTester
I have edited the answer with an example.
GeekTantra