Hi Ashish,
Please understand the concept of static variable.
By default its value set to 0(zero), and its value retain in between function switch call.
But here in your case you have declared static variable into the class and assigning the value in page_load event, you want to access same value in postback request. This is not possible with static variable the value of i will not be available in next postback request.
To implement this you can use session variable or viewstate.
use below code:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Session["abc"] = 0
}
}
protected void _lblnext_Click(object sender, EventArgs e)
{
int i=0;
if(Session["abc"] !=null)
i= Convert.ToInt32(Session["abc"]);
else
{
}
i+=1;
Session["abc"]=i;
}