Login page appears twice in ASP.NET application on IIS -
i have added login.aspx default document section in iis.
however, when accessing application, required login twice. first 1 wouldn't error message or no redirection next page in application. , second 1 redirect user expected page. , user using right credentials both times. , on local server, able login in first attempt.
i redirecting homepage.aspx login.aspx using web.config. like:
<authentication mode="forms"> <forms loginurl="login.aspx" defaulturl="home.aspx"/> </authentication>
after research found need add piece of code in page_load of login.aspx:
if (this.user.identity.isauthenticated) { response.redirect("home.aspx"); }
it worked me getting -ve effects. once close application without logging out. , if you'll try give url of login page, gives error. need clear history of browser in order run again.
does know why happening?
Comments
Post a Comment