Sunday, 6 May 2012

COUNTING CLICK USING VIEWSTATE

protected void Button1_Click(object sender, EventArgs e)
    {
int click = 1;
if(ViewState["clickcount"] == nul)
{
 click = 1;
}
else
{
click = (int)ViewState["clickcount"] + 1;
}
ViewState["clickcount] = click;
Label1.Text = "Buttonclick" + click + "times";
}

No comments:

Post a Comment

back to top