代码隐藏中DIV的语法错误

时间:2012-07-13 07:04:03

标签: c# javascript .net syntax-error code-behind

我想在下面恭维:

eventListingPanel.Controls.Add(new LiteralControl("<div style="overflow :auto; width:200px;  height:200px">"));

但是我收到了错误:

  

“)预期”

上面代码中的关键字溢出,自动,200px,200px的红色下划线

2 个答案:

答案 0 :(得分:3)

试试这个:

eventListingPanel.Controls.Add(new LiteralControl("<div style=\"overflow :auto; width:200px;  height:200px\"></div>"));

答案 1 :(得分:2)

您没有逃脱"

eventListingPanel.Controls.Add(new LiteralControl("<div style=\"overflow :auto; width:200px;  height:200px\">"));
相关问题