I am using ModalpopExtender to show a popup window when the user clicks on the one of the Row.
I dont know where I am doing mistake Its not working for me .
I am getting error TargetControlId is not found.
I am using VS2008 with C#
Here is my code.
Thanks in Advance
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:GridView ID="MyTable" AllowPaging="false" AutoGenerateColumns="false" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<a href='http:\\www.yahoo.com' id="lnkName"><%=Name%></a>
<cc1:ModalPopupExtender ID="ModalPopup1" runat="server" TargetControlID="lnkName"
PopupControlID="pnlpopup" BackgroundCssClass="modalBackground" DropShadow="true"
OkControlID="btnYes" CancelControlID="CancelBtn" />
<asp:Panel ID="pnlpopup" runat="server" CssClass="modalPopup" Style="display:none"
Width="278px" Font-Names="@MS PGothic">
Hi Would you like to Take a survey
<asp:Button ID="btnYes" runat="server" Text="Yes" />
<asp:Button ID="CancelBtn" runat="server" Text="Cancel" Width="52px" />
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Select all Open in new window
you need to one control with id="lnkName"
inside the itemtemplate you can keep it hidden also and call the event
ModalPopup1.Show()
to call the popup from any other control of GridView