//aspx code
//add your model popup css here
//your grid
<asp:GridView ID="grvLog" runat="server" CssClass="tableMain" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="LogTypeName" HeaderText="Log"/>
<asp:BoundField DataField="Message" HeaderText="Message" />
<asp:TemplateField HeaderText="Stack Trace" >
<ItemTemplate>
<asp:LinkButton ID="lnkStackTrace" runat="server" Text="Show Popup" CommandName="Display"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:button id="btnHidden" runat="server" text="Button" style="Display:none;"/>
//your extender
<asp:ModalPopupExtender ID="ModalPopup" runat="server"
OkControlID="btnOkay" TargetControlID="btnHidden" PopupControlID="DivTrace" PopupDragHandleControlID="PopupHeader"
Drag="true" BackgroundCssClass="ModalPopupBG">
</asp:ModalPopupExtender>
//code behind aspx.cs
protected void grvLog_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Display")
{
GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
//access the value of your control/ fetch the data from database and fill your pop control here like--
textboxInPopup.Text = ((TextBox)row.FindControl("txtYourTextBox")).Text;
ModalPopup.Show();
}
}