Click here to Skip to main content
15,889,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually I have Four Buttons in the .aspx page.

Fisrt time Page Load First Button should be disable. But not Second ,Third,Fourth
After that
Second time Page Load Second Button should be disable. But not Third,Fourth
After that
Third time Page Load Third Button should be disable..But not Fourth
After that
Fourth time Page Load Fourth Button should be disable.

So now you can understand what I am trying to say? So How it is possible?
If you have any idea then Please tell me as soon as possible.

You can think with the help of database, auto increment ID and many ideas etc. Actually I have tried with the help of database but it
have not done. So How it is possible?
Posted

1 solution

for this use session ,, store counter value in session and every time when page_load then increase the counter by 1. and same save in the session.

and check session value in condition :

C#
count=0;

protected void Page_Load(object sender, EventArgs e)
{
count++;
Session["count"]=count;
if(Convert.ToInt32(Session["count"])==1)
{
// code here;
button1.Enabled=true;
button2.Enabled=false;
button3.Enabled=false;
button4.Enabled=false;
}
else if(Convert.ToInt32(Session["count"])==2)
{
// code here;
button1.Enabled=false;
button2.Enabled=true;
button3.Enabled=false;
button4.Enabled=false;
}
.
.
// so on...
}

Hope this will help you.
Don't forget to mark as answer if it helps. :)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900