gkrishy gkrishy - 1 year ago 132
ASP.NET (C#) Question

How to use class in div tag inside asp.net controls InnerHtml c#

I'm trying to use div tag inside innerhtml c#. Below is my piece of code for sample,

slideUL.InnerHtml = "<div class = "slide - holder"/>"

But I'm getting compile error. Please any one guide me to proceed this.

Answer Source

You can use single quote or escape with double quote for class property. I think class name should be without any space like slide-holder. Also you have missed close </div> tag

slideUL.InnerHtml = "<div class = \"slide-holder\"/></div>"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download