I have 2 LinkButtons in my asp.net page. When I click on the first one, I want second one to be visible so I use the following code to achieve it:
LinkButtons:
<asp:LinkButton runat="server" id="LB1" OnClientClick="updateApplet(); return false;" Text="LB1" />
<asp:LinkButton runat="server" id="LB2" style="display: none;" Text="LB2" />
After some process done in updateApplet() function I want LB2 to become visible after everyhting is done. However asp page refreshes with no reason.
function updateApplet() {
var msg = document.capture.capture();
var hiddenControl = '<%= inpHide.ClientID %>';
document.getElementById(hiddenControl).value = msg;
document.getElementById('LB2').style.display = 'inherit';
// Without last line everything is perfect but I want LB2 is to be visible and this line refreshes my page :(
}
Can someone help me with my problem?
I think the reason for this is that
crashes your page and the return false of the client click doesn’t have chance to run so the page refreshes.
Try