天天躁日日躁狠狠躁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技術(shù)asp.net 中將表單提交到另一頁 Code-Behind(代碼和html在不同的頁面),轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 国产嫩草影院精品免费网址 | 亚洲伊人久久大香线蕉综合图片 | 热久久综合这里只有精品电影 | 日本女人bbb | 让人爽到湿的小黄书 | SAO货腿张开JI巴CAO死我 | 日韩高清特级特黄毛片 | 亚洲人成人77777在线播放 | 一个人在线观看免费高清视频在线观看 | 玖玖在线精品 | 青青草原在线免费 | 色妞色视频一区二区三区四区 | 亚洲视频在线观看地址 | 亚洲精品久久久久久久蜜臀老牛 | 日韩少妇爆乳无码专区 | 苍井空小公主qvod | 草莓视频在线观看完整高清免费 | 日本调教网站 | 日韩精品特黄毛片免费看 | 伊人亚洲综合青草青草久热 | 久久伊人精品青青草原2021 | 91精品欧美一区二区三区 | 激情丛林电影完整在线 | 精品久久久久久无码人妻国产馆 | 日韩精品在线观看免费 | 亚洲国产精品一区二区动图 | 国产国拍亚洲精品av麻豆 | 性欧美FREE少妇XXX | 日本亚欧热亚洲乱色视频 | 污污又黄又爽免费的网站 | 青草久久伊人 | 麻豆久久国产亚洲精品超碰热 | 粗大分开挺进内射 | 毛片无码免费无码播放 | 日韩插啊免费视频在线观看 | 首页_亚洲AV色老汉影院 | 多男同时插一个女人8p | 欧美做真爱欧免费看 | 亚洲欧美偷拍视频一区 | 九九热视频在线观看 | WWW国产精品人妻一二三区 |