我有一个asp webform站点,在一个页面上有一个带有TextMode="MultiLine"的asp:TextBox,字段代码如下所示
<asp:TextBox ID="Step04OtherField" runat="server" class="form-control" style="max-width: 100%" TextMode="MultiLine" Rows="5"></asp:TextBox>此页面在会话中存储页面上的所有详细信息,然后在下一页上显示肠信息。问题是,即使用户在文本框中输入了两个输入项,每次单击enter键时,它都会显示在确认页面的一行上,因此并不是很清楚。
是否有办法这样做,以便当会话值显示在确认页上时,每个enter键按下也会显示在此页的新行上。
会话存储在后面的代码
Session["Step04OtherField"] = Step04OtherField.Text;确认页
<div class="form-group">
<asp:Label ID="Step04BrowsersLabel" class="col-xs-6 col-sm-3 control-label" runat="server" Text="Browser(s) to check on:"></asp:Label>
<div class="col-xs-6 col-sm-9 form-control-static">
<%=Session["Step04OtherField"] %>
</div>
</div>当页面显示时,它显示为:浏览器,以检查:Entry1、Entry2等
我想要的是把它展示成
浏览器检查:Entry1
/T1459.2-1993商品、商品、商业、金融、金融、商业、商业、金融、金融、商业、金融、金融、商业、金融等领域的产品、技术、金融、金融、商业、金融、金融等领域的产品、技术、技术、金融、金融等领域的
等
发布于 2015-09-12 05:40:54
这将适用于案文部分:
Session["Step04OtherField"] = Step04OtherField.Text.Replace("\r\n", "<br />");然后,对于html格式:
<table>
<row>
<td valign="top">Browser(s) to check on:</td>
<td> <%=(string)Session["Step04OtherField"] %></td>
</row>
</table> https://stackoverflow.com/questions/32525683
复制相似问题