Hello;

I'm currently working to convert a classic ASP site to ASP.NET. I am getting the error 'Cannot convert type String to System.Web.UI.HtmlControls.GenericHTMLControls' (I'm associating frontend variable to backend). Unfortunately, Google has not been much help on this. Anyone have any pointers on this? An example of this is:

Frontend:

<div id="Message1" runat="server" /></div>

Backend:

Message1 = //verbiage here to display as message if condition is right.

Recommended Answers

All 2 Replies

Use InnerHtml or InnerText property.

Message1.InnerHtml = "text_here";

Use InnerHtml or InnerText property.

Message1.InnerHtml = "text_here";

Thanks! Does the trick.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.