【问题标题】:Syntax error for DIV in code behind隐藏代码中的 DIV 语法错误
【发布时间】:2012-07-13 07:04:03
【问题描述】:
我试图在下面暗示:
eventListingPanel.Controls.Add(new LiteralControl("<div style="overflow :auto; width:200px; height:200px">"));
但我收到一个错误:
“)预期”
上面代码中关键字overflow,auto,200px,200px的红色下划线
【问题讨论】:
标签:
c#
javascript
.net
syntax-error
code-behind
【解决方案1】:
试试这个:
eventListingPanel.Controls.Add(new LiteralControl("<div style=\"overflow :auto; width:200px; height:200px\"></div>"));
【解决方案2】:
你没有逃避你的"
eventListingPanel.Controls.Add(new LiteralControl("<div style=\"overflow :auto; width:200px; height:200px\">"));