I have an asp.net web page with asp:button control. I need to show two (normal) HTML buttons for the click event of the asp:button control.
My requirement is when the page load for the first time there will be only asp:button there visible. After I click on that asp:button other two HTML buttons should be visible. But they should be visible for all the other postbacks. I mean if there would be any post backs, that HTML buttons should be visible constantly. How could I do that? Please help me. I tried to implement that using jquery hide and show.
I have an asp.net web page with asp:button control. I need to show two
Share
You can use
<asp:Button>controls for the other two buttons, and can set Visible="false" initially, then setting Visible="true" when you need to show them. This way, the server can do everything, and retain viewstate too so you don’t have to reshow the buttons every time the page posts back.ASP buttons are standard buttons but can trigger the functionality you want through the OnClientClick property:
Using
return false;makes sure that the button doesn’t postback, and UseSubmitbehavior="false" renders an<input type='button' />instead.