Url Rewrite in asp.net url morph

once our client asked us to hide the site urls that is
if my project is having 3 pages say
and page 3.aspx

so when ever i was running project my url was shown as
http://localhost/MyProject/Page1.aspx for page 1
http://localhost/MyProject/Home.aspx for HomePage
http://localhost/MyProject/Page2.aspx for page 2
http://localhost/MyProject/Page3.aspx for page 3

so our client asked us to stop hiding all those urls and show only one url ile.,
http://localhost/MyProject/index.aspx for all the pages

so we came up with the solution called URL REWRITE CONCEPT USING IFRAME

Step1) we created one Empty aspx page named index.aspx
and in design code we placed the Following line of code
< iframe src=”Home.aspx” width=”100%” height=”100%” frameborder=”0″ scrolling=”yes” >

before Form tag
in index.aspx page

Step 2) set index.aspx as startpage

Step 3) provide link to other pages in home.aspx

step 4) Run the Web Project

here onwords the index.aspx will run internally Home.aspx there by hiding url of Home.aspx inside it

and once we are in home.aspx we can navigate to page1.aspx or page2.aspx inside it but the url wont change
it remain same as
http://localhost/MyProject/index.aspx even when in Page1 or 2 or 3 .aspx


if the iframe is coming in small window or half of the screen use this script for getting
full screen out put

< html >
< head runat=”server” >
< title></title >
< style type=”text/css” >
html, body, div, iframe { margin:0; padding:0; height:100%; }
iframe { display:block; width:100%; border:none; }
< /style >
< /head >
< body >
< iframe src=”Home.aspx” >< /iframe >

< /body >
< /html >


About kakani santosh kumar

Working as Software Engineer in Prithvi Information Solutions having 3 years of Experience in Dotnet Framework ranging from 1.1 to 3.5
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

2 Responses to Url Rewrite in asp.net url morph

  1. shiva says:

    ok we hide the url. suppose i know the url . if i type the url in address bar means it shows the page. how to restrict that

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s