如何在Asp.Net C#中执行此功能 [英] How Can I Perform This Function In Asp.Net C#

查看:66
本文介绍了如何在Asp.Net C#中执行此功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望当用户使用Id和密码登录时,他应该被引导到像facebook这样的用户页面。用户使用用户ID和密码登录并打开他的个人资料。

i了解简单登录,例如

i want that when user is log-in with the Id and password he should be directed to the page of the user same like facebook. where the user log-in with the user id and password and his profile get opened.
i know about the simple login like

Quote:

SqlDataAdapter myadp = new SqlDataAdapter();

myadp.SelectCommand = new SqlCommand();

myadp.SelectCommand.Connection = con;

con.Open();

myadp.SelectCommand.CommandText =select * from shantanu,其中Id = @un和密码= @ ps;

myadp.SelectCommand.Parameters.AddWithValue(@ un,TextBox1.Text);

myadp.SelectCommand.Parameters.AddWithValue(@ ps,TextBox2.Text);

SqlDataReader mydr;

mydr = myadp.SelectCommand.ExecuteReader();

SqlDataAdapter myadp = new SqlDataAdapter();
myadp.SelectCommand = new SqlCommand();
myadp.SelectCommand.Connection = con;
con.Open();
myadp.SelectCommand.CommandText = "select * from shantanu where Id=@un and password=@ps";
myadp.SelectCommand.Parameters.AddWithValue("@un", TextBox1.Text);
myadp.SelectCommand.Parameters.AddWithValue("@ps", TextBox2.Text);
SqlDataReader mydr;
mydr = myadp.SelectCommand.ExecuteReader();

Quote:

con.Close();

con.Close();






但我想显示与之关联的数据下一页。

请帮助我。


but i want to display the data associated with it on the next page.
kindly help me.

解决方案

所以将它存储在Cookies或Session中,然后在下一页上读取值。然后你可以非常愉快地展示它们。
So store it - either in Cookies or the Session, and read the values back on the next page. You can then display them perfectly happily.


这将让你更多地了解 OriginalGriff 建议什么



send-data-from-一页到另一个-s-sharp-asp-net [ ^ ]
This will give you more idea about what OriginalGriff suggested

send-data-from-one-page-to-another-in-c-sharp-asp-net[^]


登录成功后重定向到主页

只需运行另一个查询即可从表中获取所有配置文件详细信息,并将 UserName 作为条件。

然后在主页上显示这些信息。



会话上存储您要访问的任何值在应用程序的所有页面上。
After login is successful redirect to Home Page.
Just run another query to get all the Profile details from the table taking the UserName as a condition.
Then show these information on Home Page.

Store any value on Session, which you want to access across all the pages of the Application.


这篇关于如何在Asp.Net C#中执行此功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆