Reputation: 475
I have a JQuery dialog in asp.net
Once I clicked the button, the dialog pop up then disappears immediately. I know there is a post-back issue, butI don't know how to handle it? Say using hidden field?
Upvotes: 0
Views: 148
Reputation: 10694
Your button is asp.net server
control i.e its submit
button which causes form
submission and eventually postback
.
Change it to normal html button
<input type="button" value="open dialog" id="btn"/>
then open popup on click of that button
$('#btn').click(function(){
//open dialog
});
Or if you dont want to replace server control with html control, you can return false
from click
function
CODE
......
{
$('#dialog').dialog('open');
return false;
});
Upvotes: 2