gkrishy gkrishy - 7 days ago 5x
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.


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>"