天天躁日日躁狠狠躁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在不同的頁面),轉載需保留來源!

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

主站蜘蛛池模板: avtt天堂网2014| 欧美国产精品主播一区 | 国产精品高清m3u8在线播放 | 全黄h全肉短篇禁乱np | 欧美亚洲日韩国产在线在线 | 青草在线观看视频 | 亚洲 欧美 国产 视频二区 | 秋霞伦理电影在2017韩国在线伦 | 日本无码毛片久久久九色综合 | 伊人久久综合网站 | 国产h视频在线观看网站免费 | 国产99在线视频 | 九九99国产香蕉视频 | 国产乱码免费卡1卡二卡3卡四卡 | 一个人免费完整在线观看影院 | 女子初尝黑人巨嗷嗷叫 | 羞羞漫画在线播放 | 日韩精品无码久久一区二区三 | X8X8拨牐拨牐X8免费视频8午夜 | 香蕉视频国产精品 | 日本妈妈在线观看中文字幕 | 我们中文在线观看免费完整版 | 国产精品伊人 | 99er久久国产精品在线 | 亚洲人成在线播放无码 | 久久黄视频 | 高清日本片免费观看 | 国产午夜电影在线观看不卡 | 一个人在线观看视频 | 人人模人人干 | 妖精视频免费高清观看 | 看电影来5566一区.二区 | 快穿女主有名器的H纯肉黄暴拉文 | 日本人奶水中文影片 | 97精品国产亚洲AV高清 | 国产精品久久久久久久AV下载 | chinese学生gv video| 苍井空教师BD在线观看全集 | 各种肉黄浪荡故事集 | 成人在线视频观看 | 久久人妻熟女中文字幕AV蜜芽 |