Hi antony,
antonyliu2002@yahoo.com schrieb:
Quote:
My login page is Default.aspx as you see from above. The code-behind
of Default.aspx, i.e., Default.aspx.cs, calls a stored procedure in
SQL Server 2005, which takes the user name and password as its
parameters. It returns 1 if the username/password pair is found,
otherwise, it returns 0.
Just a thought here - it seems like you are not using the membership
provider for the logon process (you call your own stored procedure) and
rely on the integrated authorization mechansims for access control.
What I think happens is that you call the stored proc, but authorization
manager does not know that a user signed on. Therefore, the provider
redirects you to the login page.
My advice is to either use the membership provider that's included with
asp.net (downside: your database has to have the tables required which
aspnet_regsql can set up for you).
Or, if you want to keep the custom stored proc etc., create your own
membership provider.
Or, as a third option, don't rely on the authorization manager (the part
with deny ="?") but have your own routine, i.e. set a session variable
after succesful login, and check for that session variable in the
page_load of each page (and if it isn't there, redirect to your login
page manually).
Bottom line: You have to use an asp.net membership provider to use the
authorization features.
Scott Guthrie has a collection of good links on this and other
security-related matters on
http://weblogs.asp.net/scottgu/archi...esources-.aspx
Hope this helps,
Roland