c# - RedirectFromLoginPage - The resource cannot be found error -


i setting login in c#

if (textbox1.text == system.convert.tostring(row["username"]) &&         (textbox2.text == system.convert.tostring(row["password"])))             system.web.security.formsauthentication.redirectfromloginpage(textbox1.text, false);      else         label1.text = "invalid username/password"; //if incorrect show label 

once user enters correct details page saying the resource cannot found question set page should redirected to?

so far web.config looks this

<authentication mode="forms">  <forms>   </forms> 

i connecting database correct details, section works redirecting of page.

the redirectfromloginpage method redirects page specified in returnurl query string parameter or, fallback, defaulturl property specified in web.config:

<authentication mode="forms">   <forms loginurl="member_login.aspx"     defaulturl="index.aspx" /> </authentication> 

see here more info:

redirectfromlogin: http://msdn.microsoft.com/en-us/library/ka5ffkce.aspx

defaulturl: http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.defaulturl.aspx


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -