What is the HtmlGenericControl(String) equivalent class in .Net framework 4.6.1 that could be used to generate HTML content?
We are upgrading .Net framework from 4.0 to 4.6.1 for an ASP.Net web application. We have replaced System.Web.UI.HtmlControls.HtmlGenericControl with System.Web.UI.HtmlControls.HtmlElement in all classes but it resulted with the following error message.
The base class includes the field 'html', but its type (System.Web.UI.HtmlControls.HtmlGenericControl) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlElement)
The fix is also explained here.
The issue we have is that application also use HtmlGenericControl(String) constructor and replaced HtmlElement() class doesnt have a constructor that take string parameter to specify tag.
Example:
var h3Header = new HTMLGenericControl("h3");
Looking for something like this:
var h3Header = new HtmlElement("h3");