My Code is given Below:
<asp:GridView ID="gvTask" runat="server" Width="100%" GridLines="Both" AutoGenerateColumns="false"
AllowPaging="true" PageSize="30" DataKeyNames="TId" OnPageIndexChanging="gvTask_PageIndexChanging">
<Columns>
<asp:TemplateField HeaderText="Project Title" ItemStyle-CssClass="cssItemStyle" HeaderStyle-CssClass="cssItemStyle">
<ItemTemplate>
<asp:Label ID="lblPTitle" runat="server" Text='<%#Eval("PTitle")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="20%" Height="30px" HorizontalAlign="left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Task Title" ItemStyle-CssClass="cssItemStyle" HeaderStyle-CssClass="cssItemStyle">
<ItemTemplate>
<asp:Label ID="lblTTitle" runat="server" Text='<%#Eval("TName")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="25%" Height="30px" HorizontalAlign="left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Department" ItemStyle-CssClass="cssItemStyle" HeaderStyle-CssClass="cssItemStyle">
<ItemTemplate>
<asp:Label ID="lblDepartment" runat="server" Text='<%#Eval("DeptName")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="15%" Height="30px" HorizontalAlign="left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="View" ItemStyle-CssClass="cssItemStyle" HeaderStyle-CssClass="cssItemStyle">
<ItemTemplate>
<a href='AdmCreateTask.aspx?id=<%#Eval("TId")%>' style="text-decoration: none">
<asp:ImageButton ID="imgView" runat="server" ImageUrl="images/view.png" Width="30"
Height="30" AlternateText="" />
</a>
</ItemTemplate>
<ItemStyle Width="1%" Height="30px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ModalPopupExtender ID="ModalPopupExtender1" PopupControlID="Panl1" TargetControlID="imgView"
CancelControlID="btnClose" BackgroundCssClass="Background" runat="server">
</asp:ModalPopupExtender>
I want to assign the Id of ImageButton inside a GridView in TargetControlID of ModelPoppupExtender. How I will do it? Please suggest me.