当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Syntax error for DIV in code behind

问题描述:

I am trying to impliment below :

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

but i am getting an error :

") expected"

with the red underline for keywords overflow ,auto,200px, 200px in the above code

网友答案:

You're not escaping your "

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

try this:

eventListingPanel.Controls.Add(new LiteralControl("<div style=\"overflow :auto; width:200px;  height:200px\"></div>"));
分享给朋友:
您可能感兴趣的文章:
随机阅读: