我有一个登录页面,该页面连接到sql server,当我登录到首页时一切都很好,我希望用户名文本显示在首页中,但我收到错误pp为空
public partial class home : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Page pp = PreviousPage;
Control ctrl = pp.FindControl("TextBox1");
TextBox tb = (TextBox)ctrl;
string name = tb.Text;
Response.Write("name");
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("loginDB.aspx");
}
}
}