模型弹出窗口无法找到页脚模板中griedview内部的链接按钮ID [英] Model popup is not abling to find out link button id which is inside griedview in footer template
本文介绍了模型弹出窗口无法找到页脚模板中griedview内部的链接按钮ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的aspx代码是:
my aspx code is:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"/>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<asp:ModalPopupExtender runat="server"
ID="modelPopupExtender1"
TargetControlID="lbladd"
PopupControlID="popUpPanel"
BackgroundCssClass="modalBackground">
<asp:Panel ID="popUpPanel" runat="server" CssClass="pnl" Visible="false">
<div style="font-weight: bold; border: Solid 3px Aqua; <br mode=" hold=" /> background-color: AliceBlue">
<asp:Label runat="server" ID="myThrobber" Style="display: none;"><img align="absmiddle" alt="" src="images/uploading.gif"/>
<asp:AjaxFileUpload ID="AjaxFileUpload1"
runat="server"
OnUploadComplete="AjaxFileUpload1_UploadComplete"
OnClientUploadError="uploadError"
OnClientUploadComplete="uploadComplete"
ThrobberID="myThrobber"
MaximumNumberOfFiles="1"
AllowedFileTypes=""
class="name_text1"
Width="200px" />
<asp:Label ID="Label1" runat="server" Text="">
<asp:Button ID="BtnClose" runat="server" Text="Close"
OnClientClick="Closepopup()"/>
<asp:Label ID="Label2" runat="server" Text="">
<br />
<asp:GridView ID="GvAddprofile" runat="server" Width="100%" Font-Bold="False"
AllowSorting ="True" AutoGenerateColumns="False"
ShowHeaderWhenEmpty="True"
ShowFooter="True" GridLines="None" CellPadding="4"
ForeColor="#333333">
<alternatingrowstyle cssclass="alt" backcolor="White" forecolor="#284775" />
<columns>
<asp:TemplateField HeaderText="No" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle Width="5%" />
<itemtemplate>
<asp:Label ID="lbl1" runat="server" Width="10px">
<%# Container.DataItemIndex + 1 %>
</itemtemplate>
<itemstyle horizontalalign="Left" />
<asp:TemplateField HeaderText="ID1" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" Visible="false">
<HeaderStyle Width="5%" />
<itemtemplate>
<asp:Label ID="lblID" runat="server" Width="10px" Text='<%# Bind("W_filleID") %>'> >
<itemstyle horizontalalign="Left" />
<asp:TemplateField HeaderText="File Name" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle Width="45%"/>>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("fileName") %>'>
</itemtemplate>
<itemstyle horizontalalign="Left" />;asp:TemplateField HeaderText="Download Permission" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle Width="30%" />
<itemtemplate>
<asp:CheckBox ID="chkdowl" runat="server" Checked='<%# Bind("Allowdownloading") %>' AutoPostBack="true" OnCheckedChanged="chkdowl_CheckedChanged"/>
</itemtemplate>
<itemstyle horizontalalign="Left" />
<%--<asp:TemplateField HeaderText="Last Updated Date" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle Width="30%" />
<itemtemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("LastUpdatedDate") %>'>
</itemtemplate>
--%>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle Width="10%" />
<itemtemplate>
<div class="task_link"><asp:LinkButton ID="LinkButtonView" runat="server" CausesValidation="False" OnClick="LinkButtonView_Click" Text="View" ></div>
</itemtemplate>
<itemstyle horizontalalign="Left" />
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle Width="10%" />
<itemtemplate>
<div class="task_link"><asp:LinkButton ID="LinkButtonDelete" runat="server" OnClick="LinkButtonDelete_Click" CausesValidation="False" Text="Delete" ></div>
</itemtemplate>
<footertemplate>
<asp:Label ID="lbladd" runat="server" onclick="popupWindow()" class="c_text_Gvaddnew" Text="Add New">
</footertemplate>
<footerstyle width="60px" />
<itemstyle horizontalalign="Left" />
</columns>
<editrowstyle backcolor="#999999" />
<emptydatatemplate>
<asp:Label ID="lblNullRecord" runat="server" ForeColor="#FF9933"
Text="No Record Avaiable">
</emptydatatemplate>
<footerstyle backcolor="#5D7B9D" font-bold="True" forecolor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="false" ForeColor="White"/>
<pagerstyle backcolor="#284775" forecolor="White" horizontalalign="Center" />
<rowstyle backcolor="#F7F6F3" forecolor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<sortedascendingcellstyle backcolor="#E9E7E2" />
<sortedascendingheaderstyle backcolor="#506C8C" />
<sorteddescendingcellstyle backcolor="#FFFDF8" />
<sorteddescendingheaderstyle backcolor="#6F8DAE" />
</div></contenttemplate>
------------------------------
model popup is not able to find out gridview footer templete link button..
please help me its urgent....
------------------------------
model popup is not able to find out gridview footer templete link button..
please help me its urgent....
推荐答案
Follow the steps.
Go to RowDataBound event of your GridView --> Find the GridView footer --> Find your target control --> Set it as TargetControl of your ModelPopupExtender.
Try this:
Follow the steps.
Go to RowDataBound event of your GridView --> Find the GridView footer --> Find your target control --> Set it as TargetControl of your ModelPopupExtender.
Try this:
protected void GridViewName_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
Label lbladd = (Label)e.Row.FindControl("lbladd");
modelPopupExtender1.TargetControlID = lblad.ClientID;
}
}
<asp:modalpopupextender runat="server" id="modelPopupExtender1" targetcontrolid="tempLink" popupcontrolid="popUpPanel" backgroundcssclass="modalBackground" xmlns:asp="#unknown">
<asp:linkbutton id="tempLink" runat="server" visible="false" />
</asp:modalpopupextender>
--Amit
--Amit
这篇关于模型弹出窗口无法找到页脚模板中griedview内部的链接按钮ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文