JQuery Dialog box pop up through linkbuttons

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alwynroy009
    New Member
    • Jan 2014
    • 1

    #1

    JQuery Dialog box pop up through linkbuttons

    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.

    Code:
    LinkButton lnkUpdateComment = new LinkButton();
    lnkUpdateComment.ID = "" + objBridgeNotes.BridgeNotesId;
    lnkUpdateComment.Text = "edit";
    lnkUpdateComment.Attributes.Add("class", "lnkButtons");
    lnkUpdateComment.Click += new EventHandler(lnkUpdateComment_Click);
    .js file:
    Code:
    
    $(document).ready(function()  {
    
    $(".lnkButtons").live("click", function()  {
    $("#divEditComment").dialog("option", "title", "Edit the Comment");
    $("#divEditComment").dialog("open");
    return true;
    });
    
    $(function () {
    var dlg = $("#divEditComment").dialog({
        autoOpen: false,
        show: "blind",
        hide: "blind",
        //height: 450,
        minWidth: 400,
        //position: ['right', 210],
        buttons: {
            "Update Note": function () {
    
                var Updates = btnSubmitComment.replace(/_/g, '$');
                __doPostBack(Updates, '');
            }
        }
    });
    dlg.parent().appendTo(jQuery("form:first"));
    });
    
    });
    in .aspx file:

    Code:
     
        <div id="divEditComment">
    <asp:UpdatePanel ID="updComments" runat="server">
        <ContentTemplate>
            <div>
                <table width="100%" style="text-align: center">
                    <tr>
                        <td>
                            <div id="divComments" runat="server">
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
    
    </asp:UpdatePanel>
Working...