473,387 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

div runat="server" question

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

Nov 19 '05 #1
2 6150
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.
"Miguel Dias Moura" <md*REMOVE*moura@*NOSPAM*gmail.com> wrote in message
news:eS**************@TK2MSFTNGP15.phx.gbl...
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

Nov 19 '05 #2
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

"Marina" <so*****@nospam.com> wrote in message news:so*****@nospam.com:
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.
"Miguel Dias Moura" <md*REMOVE*moura@*NOSPAM*gmail.com> wrote in message
news:eS**************@TK2MSFTNGP15.phx.gbl...
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


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
5
by: Matt | last post by:
I want to know what is the purpose of runat="server" attribute?? For example, for a submit button, it just submit the form data to the server, whats the differences between <input...
2
by: Lubomir | last post by:
Hi, I have a BoundColumn in a DataGrid: <asp:BoundColumn DataField="lastname" SortExpression="lastname" ReadOnly="True" HeaderText="Last Name"></asp:BoundColumn> Column is sorted. I am...
3
by: Jim in Arizona | last post by:
Most of the asp.net learning I've done has been from books that were written during the 1.0 framework. I didn't have a copy of visual studio when I started reading them then I got a hold of VS 2005...
4
by: Kevin Blount | last post by:
bit long winded this one, so stick with me: I'm trying to create a form that can go to one of 3 places, depending on various elements. My form control looks like this: <form runat="server"...
11
by: gunjan.mait | last post by:
hi, i wanted to know the exact use of runat="server" which is being used is ASP.NET why we every time need to use it, even when i want to do the work at client side? How to do simple processings...
2
by: Bob | last post by:
Hi, in aspx file, i defined this: <input id="Button2" type="button" value="button" runat="server" onclick="klik()"/> This 'onclick' event is a clientclick (starting the Javascript function...
4
by: Chris | last post by:
Hi, i 'm experimenting with postback and i tried that with a button server control and an Html input button but with runat="server". The button server control causes a postback, but not the...
19
by: Scott M. | last post by:
Why do we need runat="server" on our <headtags?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.