String in web form keeps going to null c#
Posted on 2005-05-02
I have this code to make a string called MODE.
public class customers : System.Web.UI.Page
public string MODE="UPDATE";
Then I have a method to change the value of MODE
private void ChangeCustomerMode(string Mode)
string Change = Mode;
if (Change == "ADD")
MODE="NEW"; //I watch it set to "NEW"
btn_add_customer.Visible = false;
btn_update_customer.Text = "Add New Customer";
if (Change == "UPDATE")
btn_add_customer.Visible = true;
btn_update_customer.Text = "Update Selected Customer";
At this point the debugger says the value is now "NEW"
But then I call this method
private void btn_update_customer_Click(object sender, System.EventArgs e)
private void StoreCustomerInfo()
if (MODE == "NEW") // right here it reads as "UPDATE"
and the MODE is back to "UPDATE"
What am I doing wrong??????