Set a default page in an asp.net application

Hi,

I have an intranet site and I want my users to be able to access my home page just by inserting the ip address of the server.

There is currently another web site like this in my company so I know this is possible. I just dont know how.

Your help would be much appreciated.

Thanks again

Paul G
pgilfeatherAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

iboutchkineCommented:
You can use Server.Transfer

Keep in mind
Server.Transfer is overloaded. The overloaded version takes a second boolean
parameter indicating whether to stop processing of the current page. Pass
[true] to it to prevent this:

Server.Transfer("somepage.aspx or IP address", true);


You can enter the IP address or your web site to the text bos and then on the button click event

Server.Transfer(txt.Text, true)

0
gdexterCommented:
Is the Home Page in a Virtual Directory of the Default Web Site?

If so you can use a redirection tag in the Default.htm page of the Default Web Site

<head>
<meta http-equiv="refresh" content="0; URL=MyHomePage.htm">
</head>

Renaming the Homepage to Default.htm or Default.aspx will give you  the results desired if your home page is in its own Web Site Directory
0
pgilfeatherAuthor Commented:
Server.Transfer("somepage.aspx or IP address", true);

Is this the same in VB.NET?

Also where in my application would I put this code?

I want my user to be able to type directly into the address bar say.....if this was the server ip.....90.0.0.1 and this would take my user to the home page.

Cheers


Paul G
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

pgilfeatherAuthor Commented:
So if you were in my company and you wanted to access my site home page all you would type in is 90.0.0.1 and you will always default to my home page.
0
iboutchkineCommented:
As I told you before
You can enter the IP address or your web site to the text box and then on the button click event put the Server.Tarnsfer

0
pgilfeatherAuthor Commented:
No, no, you dont understand, this needs to be handled before the user even gets to the site never mind responding to a textbox event.

Suppose my home page url was....http://90.0.0.1/somefolder/homepage.aspx

I want my users to be able to type in http://90.0.0.1 and still get to my home page.

Hope this helps

Cheers

Paul
0
gdexterCommented:
In IIS the Default Web Site should have a Default.htm page
if it doesn't then create one.
This is the page that is shown when the IP or domain name is requested in the URL ie no virtual directoty in the path.

insert the meta tag into the head tag of that page.
<head>
<meta http-equiv="refresh" content="0; URL=somefolder/homepage.aspx">
</head>
0
iboutchkineCommented:
Where do you want your user to type
 http://90.0.0.1?
0
muzzy2003Commented:
The list of candidate default pages in a folder is a simple thing to set in IIS. Look at the site properties, or the properties of any individual folder, in Internet Services Manager (IIS 5) or IIS Manager (IIS 6), and on the documents tab is a list of the documents that the server will attempt to run in order. Add your page at the top of this list and it'll be the default page.

It's nothing to do with ASP.NET, there's no need to play with redirects or anything like that. Don't ask me why Microsoft don't put default.aspx and other obvious ASP.NET choices on the list by default, but there you go ...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob LearnedCommented:
Hello, McFly :)  Somebody's not paying attention to some pretty good advice.

Bob
0
gdexterCommented:
muzzy2003

Curious, does this approach work when the document is not in the Server Root? As is the case with this question.
0
muzzy2003Commented:
Yes, you can set a list of default pages on each directory. I don't know if they inherit from the root by default, I suspect so, but a quick test would tell you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.