假设我有以下 asp.net 页面:
public partial class SamplePage : System.Web.UI.Page
{
private int UserID;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSearchUser_Click(object sender, EventArgs e)
{
UserID = 5;
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
Response.Write(UserID.ToString());
}
}
但 UserID 始终为 0。如何实现它始终为 5?