I must be doing something wrong.

Jul 24 2007 12:46 PM

Obvious NewBee Question

See below.  I have a string variable (mystring) that I want to keep information in my partial class.  Do I really have to mark it as static to do this? 

public partial class NewClass : System.Web.UI.Page

{
static string mystring

protected void ddlFoodChoices_SelectedIndexChanged(object sender, EventArgs e)

{
mystring = "Made it to Food Choices";
}

protected void ddlFoodType_SelectedIndexChanged(object sender, EventArgs e)

{
lblfoodgroups.Text = mystring.ToString();
}


}


Answers (2)