I am trying to pass a variable with view state. I am setting the variable when the user clicks on the edit button
When I click on the edit button for the first time the variable is 0
What I am doing wrong?
public int test
{
get
{
if (ViewState["testing"] != null)
return Convert.ToInt32(ViewState["testing"]);
else
return 0;
}
set { ViewState["testing"] = value; }
}
protected void grdTest_RowCommand(object sender, GridViewCommandEventArgs e)
{
if(e.CommandName == "EditRow")
{
test = Convert.ToInt32(e.CommandArgument);
}
}
Go to the complete details ...