Reputation: 15817
A colon cannot be used in the ID of a .NET control. I quote from the following website: http://msdn.microsoft.com/en-us/library/system.web.ui.control.id.aspx
"Only combinations of alphanumeric characters and the underscore character ( _ ) are valid values for this property. Including spaces or other invalid characters will cause an ASP.NET page parser error."
Is there a reason why alphanumeric characters have to be used?
Upvotes: 0
Views: 15743
Reputation: 19963
Easy to find on MSN...
Only combinations of alphanumeric characters and the underscore character ( _ ) are valid values for this property. Including spaces or other invalid characters will cause an ASP.NET page parser error.
As for why, I cannot give an answer, other than it makes sense to me as a developer that you never use anything other than alphanumerics and underscores for variable names. There's no obvious reason why that should not extend to control IDs as well.
Upvotes: 1