在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
ASP.NET中 Button(按钮)的使用。
Button(按钮)
1, HyperLink 2,
/Button.aspx
View Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Button.aspx.cs" Inherits="WebControls_Button" %> <!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"> <div> <h3>Button(按钮)</h3> <table style="width: 100%;"> <tr> <td> 属性</td> <td> 值</td> <td> 作用</td> </tr> <tr> <td> PostBackUrl </td> <td> url </td> <td> 单击时,指向的页面 </td> </tr> <tr> <td> ToolTip </td> <td> 提示语 </td> <td> </td> </tr> </table> <hr /> 1, <asp:Button ID="btn" runat="server" Text="前台指向" PostBackUrl="~/DemoHTML.aspx" ToolTip="单价我吧!我是按钮" /> <br /> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/DemoHTML.aspx">HyperLink</asp:HyperLink> <br /> <br /> 2,<br /> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="后台单击事件" /> </div> </form> </body> </html> /Button.aspx.cs
View Code
using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class WebControls_Button : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { //方法内可以做很多操作 //注册,注册成功,跳转到主页 Response.Redirect("~/DemoHTML.aspx"); } }
https://files.cnblogs.com/ylbtech/WebForm-BasicControl-HTML.rar
|
请发表评论