如何将登录用户与数据库绑定? [英] How do I bind the login user with database?
本文介绍了如何将登录用户与数据库绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
登录后,我需要将用户重定向到特定页面,如何在c#中的asp.net中做到这一点?
如何绑定数据库中登录用户自己的数据的文本框?(即,除了用户配置文件外什么也没有).
after log in I need to redirect the user to particular page, How do i do it in asp.net in c#?
How do I bind the textboxes of login user''s own data from the database?(i.e., nothing but User Profile).
推荐答案
示例:
Session ["User"] =用户;//用户自己的数据类
Response.Redirect("profile.aspx");
Example:
Session["User"] = user;//the user''s own data class
Response.Redirect("profile.aspx");
您可以这样做..
在Login_click中,您必须编写
会话[用户名"] = txtUsername.text;
Session ["password"] = txtPassword.text;
验证用户名和密码.如果用户被授权,则重定向到这样的另一个页面..
Response.Redirect("Homepage.aspx");
我认为这可能对您有帮助.....
You can do that like this..
In the Login_click, you have to write
Session["username"]=txtUsername.text;
Session["password"]=txtPassword.text;
Verify the username and password. If the user is authorized, redirect to another page like this..
Response.Redirect("Homepage.aspx");
I think it might help you.....
这篇关于如何将登录用户与数据库绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文