返回页面时多行文本框显示 HTML 个元素

Multi Line Text Box Displays HTML Elements When Going Back To Page

我有一个 asp.net 网页表单,其中一页有多行 textbox。当用户在此字段中键入并继续时,详细信息将显示在确认页面上并显示为用户输入

例子

这是第一行

这是第二行

但是,当我点击我的编辑按钮(它会将我带回我的页面)时,我的 textbox 显示为

This is the first line<br /><br />This is the second line

我希望它保持其样式,但不知道该怎么做。详细信息存储在会话中。

代码隐藏

protected void Step07SubmitButton_Click(object sender, EventArgs e)
{
    Session["Step07OtherDetailsField"] = Step07OtherDetailsField.Text.Replace("\r\n", "<br />");
    Response.Redirect("/Quotation/pg3.aspx");
}

我在 Page_Load

中尝试了以下方法
Step07OtherDetailsField.Text.Replace("<br />", "\r\n");

还有

Step07OtherDetailsField.Text.Replace("<br />", Environment.NewLine);

但是不知为什么我调试的时候说我的.text是空的,但是字段里居然还是显示之前的写法,<br />也还是显示

您不需要更换任何东西。您只需在会话中存储值并将其显示到任何文本框,它将保持 \r 和 \t。

如果你想在 span 中显示结果然后用多行显示结果到文本框然后应用 css 无边框等