Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie stupid question 1

Status
Not open for further replies.

newora

Programmer
Aug 19, 2003
133
0
0
GB
Hi There,

I am just making the move over to ASP .NET from Windows C++. I have only read a couple of books so far, but I can not see an answer to a very simple question that has been bugging me ever since I started thinking of re-developing my apps for a web based environment.

The basic thing I can not see is that if I have a home page, which is only a basic login page, how do I display what will be the main screen with all of the required functionality, after the code has verified theat the entered username and password are valid? I know I need to point to a URL but how?

Thanks for your help and apologies for asking such a basic and stupid question - I really must be missing something here!!

P.S. if anyone has any reccomendations as to good books on ASP, please let me know. I have started with the Wrox book beginning ASP .NET 1.1 with VB .NET but might start looking at other beginner books for .NET V2.0

 
You need to redirect to a page:
Code:
Response.Redirect("SomePage.aspx")

Jim
 
That's great thanks for the quick replies.

I have also just found server.transfer("newpage.aspx")

Thanks again


 
But the Server.Transfer("newpage.aspx") won't change the URL in the address bar.
 
Also, you don't necessarily need to mess with Server.Transfer or Response.Redirect. Rather if you have a default.aspx, then you can let ASP.NET send them back to the page after login.

See here for detail on authentication:

After everything's configured properly, basically the way it would work is:
1. People navigate to or (the default page for a given directory is default.aspx).
2. ASP.NET sees that the user isn't authenticated and sends them to your login page.
3. The user logs in.
4. ASP.NET automatically sends the user back to default.aspx (or whatever other page they requested).

This approach requires no extra code or maintenance and has the added advantage of letting users get sent back to whatever page they really wanted to see rather than having to go through the home page to get there after logging in.
 
Great thanks BoulderBum - I would have never thought of that way of doing it.

It is quite depressing in some ways, as I think I have a lot to learn about this web stuff and the more I read the more I realise I do not know!!

Thanks again all.
 
thanks boulderbu, I will need that soon and know I don't have to search for it anymore. Have a star.

Christiaan Baes
Belgium

"Time for a new sig." - Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top