c# - login and logout doesn't work properly -


i have asp.net web site whit folder structure ,

-mainfolder    -account       -login.aspx       -register.aspx    -script    -styles    -usercontrols    -about.aspx    -home.aspx    -site.master    -web.config 

my problem , when go login.aspx page , log in , it's redirect default.aspx.
(what want , if log in about.aspx , after login successful , want redirect about.aspx )

and when log out , it's redirect http://localhost:-----/mainfolder/(directory listing -- /mainfolder/) .
( want , if log out about.aspx , after log out successful , want redirect about.aspx ) . how can fix ?

it looks using of default set asp.net web application project. try setting "destinationpageurl" property of asp:login control that's on login.aspx page:

markup (notice added onloggedin="loginuser_loggedin" end):

<asp:login id="loginuser" runat="server" enableviewstate="false"          renderoutertable="false" destinationpageurl="~/about.aspx"         onloggedin="loginuser_loggedin" > 

you handled "loggedin" event same login control:

protected void loginuser_loggedin(object sender, eventargs e) {     response.redirect("../about.aspx"); } 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -