本文介绍了使用PopUpExtender的ASP.NET GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 您好,我有一个从数据库填充的网格视图。 i填充它以编程方式我制作2个绑定列和一个模板字段。模板字段按钮图像中的当点击时填充ajax模型PopUp扩展器来编辑行。 如何填充模板字段中的弹出窗口? 如何将ajax模型弹出窗口连接到btn图像中我的意思是模板字段。Hello, I have a grid view populated from the database.i populate it Programmatically i make 2 bound columns and one template field.in the template field button image when clicked populate ajax model PopUp extender to edit the row .how to populate the pop up from template field ?how to connect the ajax model popup to the btn image in the template field i mean.推荐答案//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(); } } 这篇关于使用PopUpExtender的ASP.NET GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-06 14:57