一个小表单输入,提交后将在整个网站上显示用户名

A small form input which upon a submit will display the users name throughout the website

我是编码新手,所以请谅解。我正在寻找一个小表格,当用户提交它时(它只是他们的名字)我可以在整个网站上使用它。

是否可以将他们输入的任何内容存储到 Cookie 中?然后在整个网站上重新调用它?

我正在使用 .Net VB。有人能指出我应该在网上寻求帮助和指导的正确方向吗?

非常感谢您!

有几种方法可以做到这一点。我喜欢的方式:假设它是一个 ASP 网站,值来自 TextBox。

示例:

Register.aspx --> 获取值。

Session["yourSessionVariableName"] = yourTextBoxName.Text;

Home.aspx --> 检索值。 (假设您将其显示在标签上)

yourLabelName.Text = Session["yourSessionVariableName"].ToString();

如果有帮助请告诉我。 :) 快乐编码。