By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

JQuery Dialog box pop up through linkbuttons

P: 1
I have a link button. On clicking on the that linkbutton, I want a dialog box to pop up. I tried a lot but unable to proceed.

Following is the pieces of codes on how I am trying this.

in .cs file : (this is how I dynamically created the link button) (I have used lnkButtons class in my jquery.

Expand|Select|Wrap|Line Numbers
  1. LinkButton lnkUpdateComment = new LinkButton();
  2. lnkUpdateComment.ID = "" + objBridgeNotes.BridgeNotesId;
  3. lnkUpdateComment.Text = "edit";
  4. lnkUpdateComment.Attributes.Add("class", "lnkButtons");
  5. lnkUpdateComment.Click += new EventHandler(lnkUpdateComment_Click);
  6.  
.js file:
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. $(document).ready(function()  {
  4.  
  5. $(".lnkButtons").live("click", function()  {
  6. $("#divEditComment").dialog("option", "title", "Edit the Comment");
  7. $("#divEditComment").dialog("open");
  8. return true;
  9. });
  10.  
  11. $(function () {
  12. var dlg = $("#divEditComment").dialog({
  13.     autoOpen: false,
  14.     show: "blind",
  15.     hide: "blind",
  16.     //height: 450,
  17.     minWidth: 400,
  18.     //position: ['right', 210],
  19.     buttons: {
  20.         "Update Note": function () {
  21.  
  22.             var Updates = btnSubmitComment.replace(/_/g, '$');
  23.             __doPostBack(Updates, '');
  24.         }
  25.     }
  26. });
  27. dlg.parent().appendTo(jQuery("form:first"));
  28. });
  29.  
  30. });
  31.  
  32.  
in .aspx file:

Expand|Select|Wrap|Line Numbers
  1.  
  2.     <div id="divEditComment">
  3. <asp:UpdatePanel ID="updComments" runat="server">
  4.     <ContentTemplate>
  5.         <div>
  6.             <table width="100%" style="text-align: center">
  7.                 <tr>
  8.                     <td>
  9.                         <div id="divComments" runat="server">
  10.                         </div>
  11.                     </td>
  12.                 </tr>
  13.             </table>
  14.         </div>
  15.     </ContentTemplate>
  16.  
  17. </asp:UpdatePanel>
  18.  
Jan 29 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.