Click here to Skip to main content
15,887,923 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I create link button asp.net and I call fuction from JQUERY. The dialog is not open, and also refresh the page and close div tag , made visible when i click some button or check ...
<asp:LinkButton ID="Linkbutton" runat="server">Clik</asp:LinkButton>




and jquery
write...
function Open() {
$("#Linkbutton").unbind("click", function() {
       alert("Hello!");
{     $("#div").modal({ persist: true,maxheight:500,autoResize:true, onClose: function(dialog) {

};
};
}
Posted
Comments
Member 10234216 15-Oct-13 9:01am    
sorry

1 solution

You need to call the Open method somewhere for it to actually work. However, the Open method is incorrect. You unbinding the click event which won't cause the dialog to be displayed when the button is clicked

$(document).ready(function()
{
  $("#Linkbutton").click(function()
   {
     $("#div").modal(
     { persist: true,
       maxheight:500,
       autoResize:true, 
       onClose: function(dialog){}
      }
   }); 
});


Or

<asp:LinkButton ID="Linkbutton" onClientClick="Open()" runat="server">Clik</asp:LinkButton>


function Open()
{
 $("#div").modal(
 { persist: true,
  maxheight:500,
  autoResize:true,
  onClose: function(dialog){}
 }
}
 
Share this answer
 
Comments
Chamiss 29-Jun-11 12:30pm    
Thanks you for answe.. I ready try that i wasn't work because it is doing before I loginin...It supposted do when i click the link

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