今天碰到一个问题,看似简单而且合乎道理,但是就是偏偏出错了。

代码是这样的:在一个FORM里面
<div id=div1 runat=server>
<table border=1>
<tr>
<td>This is a test</td>
</tr>
</table>
</div>

后台的cs代码是:
string str = this.div1.InnerHtml;
Session[“str“] = str;
Response.Redirect(“aa.aspx“);

在编译的时候,一切正常;但是运行的时候,就在“string str = this.div1.InnerHtml;”这一句报错,说无法获得div1的内容,因为它不是文本。这个大家能帮帮忙吗?

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-03
  • 2022-01-02
  • 2021-10-16
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案