1
我有這個項目,我想從textbox1
傳輸數據與會話「sam」在about.aspx
其label
。問題是,當我輸入一個數字時,它不顯示在label
上。我的問題是I型的東西「ΑριθμόςΕπιβατών:」 textbox
(例如數字)之後,我點擊提交我需要獲得關於頁面的數字旁邊的「Ari8mos epivatwn:」來自用戶輸入的文本框的會話數據
Defaultaspxcs。 TXT:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication4
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click2(object sender, EventArgs e)
{
string txt = TextBox1.Text;
Session["sam"] = txt;
}
}
}
Aboutaspxcs.txt:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication4
{
public partial class About : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = (string)Session["sam"];
}
}
}
Aboutaspx.txt:
<%@ Page Title="About Us" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="About.aspx.cs" Inherits="WebApplication4.About" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<p>
Ari8mos epivatwn :
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</p>
</asp:Content>
https://www.dropbox.com/sh/4ftlddfhqo8n99p/gm-TNvol0S
在有關網頁,我仍然沒有得到的文本框,我輸入數字。 – Vasilis
@ user2052363它代表什麼?另外,當你調試時,你的Page_Load方法被擊中了嗎? – EtherDragon
調試很清楚。它什麼也沒有顯示,就像我沒有會議。 – Vasilis