Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a web form ,there are three buttons, like button 1 ,button 2 ,button 3,
i want that user cant make a jump from button 1 to button 3,he must follow the sequence. like

C#
after entering date into the textbox user must follow these steps 
protected void Button1_Click(object sender, EventArgs e)
{
code
}
then 
 protected void Button2_Click(object sender, EventArgs e)
{
code
}
 protected void Button1_Click(object sender, EventArgs e)
{
code
}
Posted
Updated 15-Apr-15 23:59pm
v2

That's something we try very hard to stay away from: it "forces" the user to work in a sequence which very, very few modern users do these days.

The normal way to do this for a web form would be to have multiple "pages" so the first button create a new display that has the second button, and so on. Think of the way you do this when you really have to - a first purchase on a shopping site:
Page one: email and password
Page two: address confirmation / entry
Page three: payment details
Page four: commit to buy.
And each page has a "back" button.

You don't do this on a single page (because it's confusing) so why would your task be any different? Procedural inputs where the app controlled the order in which the user handled a page are very, very rare these days.
 
Share this answer
 
You can use Mulltiview control in your webpage, Where you can have 3 Views and each view will have a button. On click of button it will switch to next view. For reference you can refer below multi view example.

http://www.tutorialspoint.com/asp.net/asp.net_multi_views.htm[^]
 
Share this answer
 
C#
i have used following solution
on Page_Load set
button2.visible = false;

button3.visible = false
 and when function of button1 is completed then it call 
button2.visible = true;
same as above and when function of button2 is completed then it call 
button3.visible = true;
 
Share this answer
 

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