Home > Net >  Loginview change state after a user validation
Loginview change state after a user validation

Time:10-04

Use VS2015 to create a new website, ASP.NET Web form with user registration, login page, and MSSQLLocalDB database,
I want to take advantage of the System to the login page to the native SQL database user login, all is done, just after the login, Web SIT stamper in loginview status hasn't changed, I guess it is no use should be the original login authentication, so the System authentication failed, version encountered this problem before, after login successfully added: System. Web. Security. FormsAuthentication. SetAuthCookie (xueh, true); Is good, but not make, 2015
Please teach a great god, how user login using self-built data after successful change the display status loginview,

SqlDataSource1. SelectParameters [r]. "xuehao" DefaultValue=https://bbs.csdn.net/topics/Loginuser.UserName;
SqlDataSource1. SelectParameters [r]. "mima" DefaultValue=https://bbs.csdn.net/topics/Loginuser.Password;
DataView dv1=(DataView) this. SqlDataSource1. Select (DataSourceSelectArguments. Empty);
If (dv1. Table. Rows. Count & gt; 0)
{
String xueh=Loginuser. UserName;
The Session [" xueh "]=xueh;
System. Web. Security. FormsAuthentication. SetAuthCookie (xueh, true);
Response. Redirect (" index. Aspx ");

}

CodePudding user response:

Without the control for a long time, you can use this control to invoke the membership object, not the SESSION

CodePudding user response:

https://blog.csdn.net/ztg2006/article/details/4533623
  • Related