ASP.Net 2.0 and the annoying <div> wrappers

G

Guest

Hi you all,

I've just downloaded the latest beta of the .Net Framework and Visual Studio
Expression 2005 edition. I only created a simple ASPX file with some
code-beside/behind (however you want to call it). First thing I checked was
the generated html-output and I was shocked! I found <div>-tags everywhere
.... what are they for? which w3c standard or recommendation was intended to
be covered by this tags???

However I thought I could get rid of them by creating my own HtmlTextWriter,
BUT this didn't work. In case you inherit from Html32TextWriter the page will
always use that <div> tags. Does anyone have an idea?

How can I get rid of those <div>-Tags???

Thanks in advance.
Patrick
 
P

Patrice

What controls do you have on your page ? What browser are you using ?

Still using Visual Web Devleoper beta 1 here...

Patrice
 
G

Guest

Hi Patrice,

no matter what control the viewstate hidden-fields are already wrapped
around such a <div>-tag. I'm using Internet Explorer 6.x.

Patrick
 
T

TDAVISJR

Obviously you have something against the <div> tag. They will do no harm to
the way your page renders. However, to turn them off try switching the
browser validation at the top. Currently it might be set to XHTML (which
use <div> tags alot), you can try changing it to IE 6 or even lower.
 
G

Guest

Hi TDAVISJR,

Are you sure this validation works? I will give it a try.
However, I would still like to know what this <div> tags are for? Why should
the page ouput size be increased by any tags which are not used or even have
no effect? WHAT FOR???

Thanks
Patrick
 
G

Guest

Hi TDAVISJR,

I understand and know the benifits of a <div> tag, but why should someone
surround "<input type='hiddne' ... />" fields with a <div> tag. I do not
understand that... Sorry. Could you (or anybody else) enlight me?

Thanks
Patrick
 
K

Kevin Spencer

Hi Patrick,

As you've observed, there is no reason to have a div tag around a hidden
form field. On the other hand, there is no harm in having a div tag around a
hidden form field. The div tag is part of the base class, and it's simpler
and more efficient to just leave it in than to create some workaround to
remove it, or create some other base class to add to the model.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
P

Patrice

Ok same here with the previous release. All "standard" (EVENTXXX And
VIEWSTATE) hidden fields are embedded in to a single div section... User
hidden fields are not embedded into a DIV tag.

IMO your best bet would be to suggest removing this tag in case it was not
made on purpose. Anyway it doesn't seem to cause any problem here....

Patrice

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top