通过链接按钮弹出JQuery对话框

我有一个链接按钮.点击那个链接按钮,我想弹出一个对话框.我试了很多,但无法继续.
以下是关于我如何尝试这一点的代码片段.
在.cs文件中:(这是我动态创建链接按钮的方式)(我在jQuery中使用了lnkButton类.

选择 | 换行 | 行号
  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文件:

选择 | 换行 | 行号
  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.  

在.aspx文件中:

选择 | 换行 | 行号
  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.  

标签: Javascript

添加新评论