3 basic questions on asp.net

W

Wiktor Zychla

Hello,

I am an experienced Win.Forms developer and now I am learning ASP.NET
(no ASP background). there are some basic issues I do not understand and
cannot find any satisfable answers.

1. my application is configured to use Welcome.aspx as the default page.
after the succesful login via Forms authentication (user is redirected to
login.aspx) I try to reset the authentication via

FormsAuthentication.SignOut();
Response.Redirect( "login.aspx" );

this, alas, resets the FormsAuthentication.GetRedirectUrl( "userName",
false ); value to "default.aspx" (while beeing "welcome.aspx" for the first
time) and after the login procedure, the user is redirected to
"default.aspx" instead of "welcome.aspx".

the question:
a) how do I control the default page name, so it is not resets to
"default.aspx"?

2. I understand that to have any data shared by several pages I have to use
cookies to store the values. there's a special containter for such data in
the Application object (HttpApplicationState).

Questions:
a) where the typical browser stores these values? I tried to look for a
cookie in the user cookies directory with no success.
b) how to get rid of these values? even the browser restart does not resets
them.


Thanks in advance for your answers.
Wiktor Zychla
 
C

Cowboy \(Gregory A. Beamer\)

Wiktor Zychla said:
Hello,

I am an experienced Win.Forms developer and now I am learning ASP.NET
(no ASP background). there are some basic issues I do not understand and
cannot find any satisfable answers.

1. my application is configured to use Welcome.aspx as the default page.
after the succesful login via Forms authentication (user is redirected to
login.aspx) I try to reset the authentication via

FormsAuthentication.SignOut();
Response.Redirect( "login.aspx" );

this, alas, resets the FormsAuthentication.GetRedirectUrl( "userName",
false ); value to "default.aspx" (while beeing "welcome.aspx" for the first
time) and after the login procedure, the user is redirected to
"default.aspx" instead of "welcome.aspx".

Right, the default.aspx is hard coded when you go directly to the login
page.
the question:
a) how do I control the default page name, so it is not resets to
"default.aspx"?

If you find a way, you are doing better than me. I tried changing the
default page in IIS, et al, but this value appears to be hardcoded in the
ASP.NET runtime. I, personally, find this very annoying. Thank you for
reminding me, as I want to put a wish in for ASP.NET 2.0 on this issue.
2. I understand that to have any data shared by several pages I have to use
cookies to store the values. there's a special containter for such data in
the Application object (HttpApplicationState).

Questions:
a) where the typical browser stores these values? I tried to look for a
cookie in the user cookies directory with no success.

There are user cookies and server cookies. User cookies can easily be
blocked, while server cookies cannot. Many items are stored in server
cookies.

In the case of Application state, it is not stored in cookies, as it applies
to the Application, not the session. If you want user specific information,
store in session (is in a cookie) or roll your own user object.
b) how to get rid of these values? even the browser restart does not resets
them.

Restart the application is the best way for App state values. This is not
where you want to store user specific info.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top