Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop a postback in javascript

i have an ASP webform with a JQuery Thickbox, i have an image that opens the thickbox when user click.

once open the thickbox it shows me a grid with several rows and a button to select one and after the user select the record it returns to the main page the recordselected and cause a __doPostBack()

BUT! sometimes in IE6 it stay loading the postback and never ends i have to refresh the page and when it refresh it shows everything fine. but i dont want the postback stay loading AND it does not happend always.

i have to call a __doPostBack because i need to find info related to the selected record.

thanks.

like image 536
jmpena Avatar asked Dec 17 '22 08:12

jmpena


1 Answers

How I do it; How I've done it:

<asp:LinkButton ID="linkKB" OnClientClick="absolutizeWidth(); return false;"  runat="server">Columns too small?</asp:LinkButton>

The "return false" stops the postback of the server control after the javascript function executes. Very useful.

like image 140
rhett Avatar answered Dec 30 '22 16:12

rhett