【发布时间】:2021-05-12 15:30:19
【问题描述】:
这是webform1 代码,我创建了一个名为 pass 的字符串来存储文本。我应该在webform2 中做什么以根据条件显示消息?
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("two.aspx", true);
if (Request.Form["TextBox1"] != null && Request.Form["TextBox2"] != null)
{
if (RadioButton2.Checked)
{
//pass = Response.ToString().Insert(Response.ToString().Count(), " " + "Welcome, " + Server.HtmlEncode(Request.QueryString["TextBox1"]) + ". <br/> The url is " + Server.HtmlEncode(Request.Url.ToString()));
pass = "Thank you Ms. " + TextBox1.Text + "Your Registration has been successfully completed" ;
}
else if (RadioButton1.Checked)
{
pass = "Thank you Mr. " + TextBox1.Text + "Your Registration has been successfully completed";
}
}
}
【问题讨论】:
标签: c# visual-studio webforms textbox