How to use jquery modal dialogs for Edit and Display record?
<p>1) If i click the view button from the grid, it has to display jquery dialog for that particular LID, but it is not working.(In the dialog, it has to show only REMARKS1 column text)</p>

<p>2) I have included the linkbutton(Cancel/Edit) through c# code to edit the particular row. 
    How can i use jquery dialog for edit/Cancel.  </p>

<p>I have pasted my aspx webpage and C# code.It would be great if you can change this code, otherwise please provide new code.
    Please find the attached image, it will show you grid and dialog box. </p>

<pre><code>![enter image description here][1]


  [1]: http://i.stack.imgur.com/AXbcr.png

aspx page *

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;

    &lt;link href="jquery/themes/dark-hive/jquery-ui.css" rel="stylesheet" type="text/css" /&gt;
    &lt;script src="jquery/jquery-1.9.0.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.core.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.widget.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.mouse.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.draggable.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.position.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.button.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.dialog.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.effect.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.effect-slide.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.effect-explode.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="jquery/ui/jquery.ui.effect-fade.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;link href="jquery/themes/demos.css" rel="stylesheet" type="text/css" /&gt;

    &lt;script type="text/javascript"&gt;
    $(document).ready(function () {
        $("#example1").dialog({
            modal: true,
            autoOpen: false,
                show: {
                    effect: "slide",
                    duration: 1000
                },
                hide: {
                    effect: "explode",
                    duration: 1000
                }

            });

            $('#btuser').click(function (event) {
                event.preventDefault();
                $('#example1').dialog('open');
            });
        });
    &lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
        &lt;div style="height: 500px;"&gt;
            &lt;asp:GridView ID="grdDisplay" runat="server" AutoGenerateColumns="False" CellPadding="1"
                CellSpacing="1" Height="0px" GridLines="None" CssClass="myGrid" PagerStyle-CssClass="pager"
                AlternatingRowStyle-CssClass="alt" Width="1024px" RowStyle-CssClass="RowStyle"
                Font-Bold="False" Font-Names="Segoe UI" Font-Size="13px" OnRowDataBound="grdDisplay_RowDataBound"&gt;
                &lt;AlternatingRowStyle CssClass="alt"&gt;&lt;/AlternatingRowStyle&gt;
                &lt;Columns&gt;
                    &lt;asp:BoundField HeaderText="LID" DataField="l_ID" ItemStyle-Width="45px" /&gt;
                    &lt;asp:BoundField HeaderText="S_Date" DataField="s_date" DataFormatString="{0:dd-MM-yyyy}" ItemStyle-Width="60px" /&gt;
                    &lt;asp:BoundField HeaderText="E_Date" DataField="e_date" DataFormatString="{0:dd-MM-yyyy}" ItemStyle-Width="60px" /&gt;
                    &lt;asp:BoundField HeaderText="Div" DataField="Div_type" /&gt;
                    &lt;asp:TemplateField HeaderText="Remarks1" ItemStyle-Width="125px" ItemStyle-Height="25px"&gt;
                        &lt;ItemTemplate&gt;
                                &lt;asp:TextBox runat="server" ID="lblreason" Text='&lt;%# Bind("Remarks1") %&gt;' Height="20" Width="90" ReadOnly="true" CssClass="cmdtextbox"&gt;
                                &lt;/asp:TextBox&gt;
                          &lt;div style="margin-top: 0px; float: right;"&gt;
                                &lt;asp:Button runat="server" Width="25" Height="25" ID="btuser" CssClass="btreason" text="View" /&gt;
                          &lt;/div&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;
                    &lt;asp:BoundField HeaderText="Remarks2" DataField="Remarks2" ItemStyle-Width="62px" /&gt;
                    &lt;/asp:TemplateField&gt;
                    &lt;asp:BoundField HeaderText="Remarks3" DataField="Remarks3" ItemStyle-Width="60px" /&gt;
                &lt;/Columns&gt;
                &lt;PagerStyle CssClass="pager"&gt;&lt;/PagerStyle&gt;
                &lt;RowStyle CssClass="RowStyle" /&gt;
            &lt;/asp:GridView&gt;
        &lt;/div&gt;

    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

C# code*
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dtmydata = new DataTable();
            if (!Page.IsPostBack)
            {
                dtmydata = Dtthandler.GetEmData(HttpContext.Current.Session["TatID"].ToString());
                //Add new column
                dtmydata.Columns.Add(new DataColumn("User Action", Type.GetType("System.String")));

                foreach (DataRow row in dtmydata.Rows)
                {
                    currentdate =  DateTime.Now;
                    Edate = Convert.ToDateTime(row[2].ToString());
                    strtmpCdate = currentdate.ToShortDateString();
                    strtmpEdate = Edate.ToShortDateString();
                    if (Convert.ToDateTime(strtmpCdate) &lt;= Convert.ToDateTime(strtmpEdate))
                    {
                        row[7] = "Yes";
                    }
                    else
                    {
                        row[7] = "No";
                    }
                    //Bind data to grid
                    grdDisplay.DataSource = dtmydata;
                    grdDisplay.DataBind();
                }

            }

        }

        protected void grdDisplay_RowDataBound(object sender, GridViewRowEventArgs e)
        {
                    LinkButton lnkbtnCancel = new LinkButton();
                    LinkButton lnkbtnModify = new LinkButton();
            try
            {

                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    if (e.Row.Cells[7].Text == "Yes")
                    {
                            lnkbtnCancel.Text = "Cancel";
                            lnkbtnModify.Text = "Modify";

                            e.Row.Cells[7].Controls.Add(lnkbtnCancel);
                            e.Row.Cells[7].Controls.Add(lnkbtnModify);

            //How to populate jquery dialog using this linkbutton?              

                     }

                    else
                    {
                        e.Row.Cells[7].Text = string.Empty;
                    }
                }

            }
            catch (Exception ex)
            {

            }
        }
</code></pre>
