سؤال

I need help in creating a simple login control using 2 custom text boxes to allow users to log into a profile of their own. I have created the profile page. But I'm kind of clueless on how to write the code behind the

> btnLogin

I have a register page which allows me perfectly to save the details onto a SQL database table. I know this must be a simple set of code but I'm probably making it too complicated. as an example

my text box Variables are

txtUserName

txtPassword

My SQL table name is UserDetails which includes the Username and password and few other fields which is irrelevant to the login activity.

............ Response redirect page I want the User to go to is ProfileOfUser.aspx based on UserIds. something similar to this,

Response.Redirect("ProfileOfUser.aspx?Id=" + Session["UserId"].ToString());

would be really appreciative if anyone can help me figure this out :)

هل كانت مفيدة؟

المحلول

Why don't you use ASP.NET login control? ASP.NET Login Controls

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top