Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide page name and querystring in ASP.NET?

I want to set URL Masking in asp.net to hide page name and querystring in URL.

Currently i am setting below code to perform url rewriting in Global Application File.

routeCollection.MapPageRoute("Login", "Login", "~/frmLogin.aspx");

But i want to rewrite URL in a way that it will show only domain name to end user. http://www.domainname.com - like this

Please help me to set it.

Thanks in advance,

like image 326
Chirag Avatar asked Dec 26 '22 18:12

Chirag


2 Answers

You can set frmLogin.aspx page as default page in web server.

If you are using IIS 7, steps are as follows:

 1.Select your website
 2. In description click on default document
 3. Add your page (frmLogin.aspx) in and set its priority.
like image 169
Anupam Singh Avatar answered Dec 28 '22 07:12

Anupam Singh


We're using the following method in our application to show the sign-page simply on the domains. It can be modified for other pages as well.

In Global.asax:

routeCollection.MapPageRoute("SIGNIN", String.Empty, "~/signin.aspx");
like image 27
navigator Avatar answered Dec 28 '22 06:12

navigator