aspx页面
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Test_Default" %> <%@ 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> <style type="text/css"> *{padding:0;margin:0;font-size:12px;} .modalBackground { background-color:#ccc; filter:alpha(opacity=70); opacity:0.7; } .modalPopup { background-color:#ffffdd; border-width:3px; border-style:solid; border-color:Gray; padding:3px; width:250px; } </style> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Panel ID="Panel1" runat="server" > <div class="modalPopup"> Please Input Your Name:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br /><br/> <asp:Button ID="btnAgree" runat="server" Text="Agree" onclick="btnAgree_Click" style="display:none"/> <asp:Button ID="Button1" runat="server" Text="Button1" onclick="btnAgree_Click" /> <asp:Button ID="btnCancel" runat="server" Text="Cancel" /> </div> </asp:Panel> <cc1:ModalPopupExtender ID="Panel1_ModalPopupExtender" runat="server" BackgroundCssClass="modalBackground" Enabled="True" TargetControlID="LinkButton1" PopupControlID = "Panel1" OkControlID = "btnAgree" CancelControlID = "btnCancel" DropShadow="true" > </cc1:ModalPopupExtender> <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton> </form> </body> </html>
后端cs内容:
using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Test_Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnAgree_Click(object sender, EventArgs e) { LinkButton1.Text = this.TextBox1.Text; } }
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦