[英]Access variable in aspx.cs file and display in text box
Here is my Emial.Aspx.cs file. 这是我的Emial.Aspx.cs文件。 I have a public variable called loginEmail.
我有一个名为loginEmail的公共变量。
public String loginEmail;
protected void Page_Load(object sender, EventArgs e){
loginEmail= Session["Email"].ToString();
}
I want to display that variable in bellow textbox. 我想在波纹管文本框中显示该变量。 But this is not worked for me.
但这对我不起作用。
<td>
<asp:TextBox ID="TextBox_name" runat="server" Text = "<%= loginEmail %>";></asp:TextBox>
</td>
Error: 错误:
Parser Error Message: Server tags cannot contain <% ... %> constructs.
Please help me. 请帮我。
在页面加载事件中
TextBox_name.Text = loginEmail;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.