I am currently facing a dilemma while converting my front end written in HTML to ASP. The issue arises because many controls have names with "-" in them, causing significant headaches as there is no time to rename everything. Using "ctrl-f" and replace breaks the CSS somehow. Is there a way to access these controls in the code behind even when they contain dashes? I have attempted the following code snippets.
// Attempted to find control without dash, but it disrupts CSS after replace operation
HtmlGenericControl body = (HtmlGenericControl)this.Page.FindControl("page-list");
body.Attributes.Add("class", GlobalVariables.webAppSkin);
// Tried this approach as well, but 'logout' remains null
WebControl logout = (WebControl)Page.FindControl("logout-link");
Here is the HTML control in question:
<body id="page-list">