J
Jeff
Hey
asp.net 2.0
Below is the code I have behind a web page. The problem is during runtime in
btnSave_Click, userProfile has a NULL value. I don't understand why it has a
NULL value, because AFAIK I've declared userProfile as a class variable so
the value it has in btnSave_Click should be the value it did get in
Page_Load. userProfile get a value in Page_Load - but is NULL in
btnSave_Click
What am I doing wrong here?
public partial class EditUser : System.Web.UI.Page
{
private ProfileCommon userProfile;
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
string username = Request.QueryString["user"].ToString();
if (username.Length > 0)
{
userProfile = Profile.GetProfile(username);
this.Settings1.SetText(userProfile);
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
this.Settings1.SaveInfo(userProfile);
}
}
asp.net 2.0
Below is the code I have behind a web page. The problem is during runtime in
btnSave_Click, userProfile has a NULL value. I don't understand why it has a
NULL value, because AFAIK I've declared userProfile as a class variable so
the value it has in btnSave_Click should be the value it did get in
Page_Load. userProfile get a value in Page_Load - but is NULL in
btnSave_Click
What am I doing wrong here?
public partial class EditUser : System.Web.UI.Page
{
private ProfileCommon userProfile;
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
string username = Request.QueryString["user"].ToString();
if (username.Length > 0)
{
userProfile = Profile.GetProfile(username);
this.Settings1.SetText(userProfile);
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
this.Settings1.SaveInfo(userProfile);
}
}