您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
aspx:
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication4.WebForm1" %>
- <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <asp:ScriptManager ID="ScriptManager1" runat="server" />
-
- <div>
- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
- <ContentTemplate>
- <cc1:ModalPopupExtender TargetControlID="HiddenField1" BackgroundCssClass="modalBackground"
- PopupControlID="Panel1" ID="ModalPopupExtender1" runat="server">
- </cc1:ModalPopupExtender>
- <asp:HiddenField ID="HiddenField1" runat="server" />
- <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px" CssClass="confirmPanel"
- Style="display: none">
- <asp:Button ID="Button2" runat="server" Text="确定" OnClick="Button2_Click" />
- <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
- <asp:Button ID="Button3" runat="server" Text="取消" />
- </asp:Panel>
- <asp:GridView ID="GridView1" runat="server">
- <Columns>
- <asp:TemplateField>
- <ItemTemplate>
- <asp:Button ID="Button4" runat="server" Text="编辑" CommandArgument='<%# Eval("id") %>'
- OnClick="Button4_Click" />
- </ItemTemplate>
- </asp:TemplateField>
- </Columns>
- </asp:GridView>
- </ContentTemplate>
- </asp:UpdatePanel>
- </div>
- </form>
- </body>
- </html>
cs:
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- namespace WebApplication4
- {
- public partial class WebForm1 : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void Button4_Click(object sender, EventArgs e)
- {
- int id = int.Parse((sender as Button).CommandArgument);
- TextBox1.Text = id.ToString();
- ModalPopupExtender1.Show();
- }
- protected void Button2_Click(object sender, EventArgs e)
- {
- //更新数据
- //重新绑定gridview
- ModalPopupExtender1.Hide();
- }
- }
- }
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。