天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

asp.net 中將表單提交到另一頁 Code-Behind(代碼和html在不同的頁面)

The following shows a complete example of the code-behind file associated with the Web Forms page sending the information. Depending on whether you use Visual Basic or C#, make sure this sample is called Firstpage.ASPx.vb or Firstpage.ASPx.cs, respectively.
[Visual Basic]
Imports System
Public Class FirstPageClass :
Inherits System.Web.UI.Page
Protected first As System.Web.UI.WebControls.TextBox
Protected last As System.Web.UI.WebControls.TextBox
Protected Button1 As System.Web.UI.WebControls.Button
Public ReadOnly Property FirstName() As String
Get
' first is the name of a TextBox control.
Return first.Text
End Get
End Property
Public ReadOnly Property LastName() As String
Get
' last is the name of a TextBox control.
Return last.Text
End Get
End Property
Sub ButtonClicked(sender As Object, e As EventArgs)
Server.Transfer("secondpage.ASPx")
End Sub
End Class
[C#]
using System;
public class FirstPageClass : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox first;
protected System.Web.UI.WebControls.TextBox last;
protected System.Web.UI.WebControls.Button Button1;
public string FirstName
{
get
{
return first.Text;
}
}
public string LastName
{
get
{
return last.Text;
}
}
void ButtonClicked(object sender, EventArgs e)
{
Server.Transfer("secondpage.ASPx");
}
}
The following shows a complete example of how to create a Web Forms page with a code-behind file to pass the values of two TextBox controls to another Web Forms page. Make sure this sample is called Firstpage.ASPx.
[Visual Basic]
<%@ Page Language="VB" Inherits="FirstPageClass" %>
<html>
<head>
</head>
<body>
<form runat="server">
First Name:
<ASP:TextBox id="first"
runat="server"/>
<br>
Last Name:
<ASP:TextBox id="last"
runat="server"/>
<br>
<ASP:Button
id="Button1"
OnClick="ButtonClicked"
Text="Go to second page"
runat=server />
</form>
</body>
</html>
[C#]
<%@ Page Language="C#" Inherits="FirstPageClass" %>
<html>
<head>
</head>
<body>
<form runat="server">
First Name:
<ASP:TextBox id="first"
runat="server"/>
<br>
Last Name:
<ASP:TextBox id="last"
runat="server"/>
<br>
<ASP:Button
id="Button1"
OnClick="ButtonClicked"
Text="Go to second page"
runat=server />
</form>
</body>
</html>
To receive Server control values from a different Web Forms page
The following shows a complete example of the code-behind file associated with the Web Forms page receiving the information. Depending on whether you use Visual Basic or C#, make sure this sample is called Secondpage.ASPx.vb or Secondpage.ASPx.cs, respectively.
[Visual Basic]
Imports System
Public Class SecondPageClass
Inherits System.Web.UI.Page
Protected DisplayLabel As System.Web.UI.WebControls.Label
Public fp As FirstPageClass
Sub Page_Load()
If Not IsPostBack Then
fp = CType(Context.Handler, FirstPageClass)
End If
End Sub
End Class
[C#]
using System;
public class SecondPageClass : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label DisplayLabel;
public FirstPageClass fp;
void Page_Load()
{
if (!IsPostBack)
{
fp = (FirstPageClass) Context.Handler;
}
}
}
The following shows a complete example of how to create a Web Forms page with a code-behind file to receive the values passed from a different Web Forms page. Make sure this sample is called Secondpage.ASPx
[Visual Basic]
<%@ Page Language="VB" Inherits="SecondPageClass" %>
<%@ Reference Page="firstpage.ASPx" %>
<html>
<head>
</head>
<body>
<form runat="server">
Hello <%=fp.FirstName%> <%=fp.LastName%>
</form>
</body>
</html>
[C#]
<%@ Page Language="C#" Inherits="SecondPageClass" %>
<%@ Reference Page="firstpage.ASPx" %>
<html>
<head>
</head>
<body>
<form runat="server">
Hello <%=fp.FirstName%> <%=fp.LastName%>
</form>
</body>
</html>

AspNet技術asp.net 中將表單提交到另一頁 Code-Behind(代碼和html在不同的頁面),轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 蜜桃传媒星空传媒在线播放 | 女人被躁到高潮嗷嗷叫小 | 511麻豆视传媒精品AV | 国产精品久久久久久人妻精品蜜桃 | 好大好硬好湿再深一点网站 | 国精产品一区二区三区有限公司 | 美女的避毛 | 国产亚洲欧洲日韩在线观看 | 在线播放一区二区精品产 | 特黄特黄aaaa级毛片免费看 | 羲义嫁密着中出交尾gvg794 | 国产精品黄色大片 | 呜呜别塞了啊抽插 | 女人高潮久久久叫人喷水 | 嫩B人妻精品一区二区三区 内射一区二区精品视频在线观看 | 六级黄色片 | sao虎影院桃红视频在线观看 | 色欲AV精品一区二区入口 | 欧美乱码卡一卡二卡四卡免费 | 一本之道高清在线观看一区 | 麻豆AV蜜桃AV久久 | 国产精品美女WWW爽爽爽视频 | 欧美日韩中文国产一区 | 欧美成人无码视频午夜福利 | 亚洲精品第一综合99久久 | 亚洲最大在线视频 | 日韩少妇爆乳无码专区 | 一个人色导航 | 黄色天堂在线 | 国产色精品VR一区二区 | 强行撕开衣服捏胸黄文 | 国产亚洲精品成人AV久久 | 和尚扒开双腿蹂躏 | 成片免费观看视频大全 | 好男人在线观看视频观看高清视频免费 | 伊人电院网 | 一个人色导航 | 青柠电影在线看 | 国产精品亚洲AV色欲在线观看 | 久久99re66热这里只有精品 | 国产伦子沙发午休系列资源曝光 |