Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

JQuery Dialog box pop up through linkbuttons

alwynroy009alwynroy009 BangalorePosts: 0Member

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.

LinkButton lnkUpdateComment = new LinkButton();
lnkUpdateComment.ID = "" + objBridgeNotes.BridgeNotesId;
lnkUpdateComment.Text = "edit";
lnkUpdateComment.Attributes.Add("class", "lnkButtons");
lnkUpdateComment.Click += new EventHandler(lnkUpdateComment_Click);

.js file:

$(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:

<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>

Tagged:
Sign In or Register to comment.