div runat="server" question

  • Thread starter Thread starter Miguel Dias Moura
  • Start date Start date
M

Miguel Dias Moura

Hello,

I have this line:
<div runat="server" id="category-header">

I get this error:
'category-header' is not a valid identifier.

When I use:
<div runat="server" id="category-header">
I have no problems.

Is that I can't use the "-" in id's?

How should I separate words in an id?

I was checking and W3C allows "-" and "_".

However it seems some browers have some problems with it.

I am lost about it.

How should I use my id's? What do you sugest me?

Thanks,
Miguel
 
First off, the 2 things you posted look the same to me.

But to answer your questions, I think the issue, at least partly, is that in
..NET, you cannot have '-' in the name of a variable. Whereas '_' is valid.

Just use the underscore, that is very typical.
 
Thanks,

Yes you are right. They were 2 different problems so I didn't know if I
should or should not send 2 different post's.

Thanks again,
Miguel
 
Back
Top