I am working on a new project for a client; they have supplied the site design which I need to move onto our content management system.
.NET doesn’t seem to like the id’s that are scattered throughout the theme.
Is there any reason why – throws …is not a valid identifier?
Cheers for any responses.
Examples
<form id="login-form" runat="server">
<input type="text" name="username" runat="server" id="login-username" placeholder="Username" />
Update
Seems that changing – to _ fixes the issue. Answer below!
Matt
In ASP.NET, when you use
runat="SERVER", then the “ID” naming convention must follow the naming convention of the properties and fields. The “-” character is not allowed in field names.