2
Answers

I must be doing something wrong.

Bryan Homrighous

Bryan Homrighous

17y
1.7k
1

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)