Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET 2.0, it seems to wrap a div around the hidden form fields

Reply
Thread Tools

ASP.NET 2.0, it seems to wrap a div around the hidden form fields

 
 
Thor W Hammer
Guest
Posts: n/a
 
      11-09-2005
In ASP.NET 2.0, it seems to wrap a div around the hidden form fields such as
__ViewState. How do you override this rendering?


 
Reply With Quote
 
 
 
 
Bruce Barker
Guest
Posts: n/a
 
      11-09-2005
please report it as a bug if enough of us do, maybe MS will fix it (it
causes all kinds of layout problems).

the only fix is a post processing httphandler that strips the divs out. i
haven't written one yet, but i'm close.


-- bruce (sqlwork.com)



"Thor W Hammer" <(E-Mail Removed)> wrote in message
news:437146df$(E-Mail Removed)...
> In ASP.NET 2.0, it seems to wrap a div around the hidden form fields such
> as
> __ViewState. How do you override this rendering?
>
>



 
Reply With Quote
 
 
 
 
Greg Burns
Guest
Posts: n/a
 
      11-09-2005
http://www.aspnetpro.com/newslettera...200511de_l.asp

"ASP.NET 2.0 defaults to XHTML 1.1, but you can also opt for XHTML 1.0
Strict or Transitional. The rendering engine of some controls has been
reworked to make them produce compliant output. As a result, in ASP.NET 2.0,
each control's markup includes a closing tag. Furthermore, the viewstate
hidden field comes surrounded by a <div> tag and the form is only identified
by the ID attribute."

Sounds like they did this for a reason.

Greg


"Bruce Barker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> please report it as a bug if enough of us do, maybe MS will fix it (it
> causes all kinds of layout problems).
>
> the only fix is a post processing httphandler that strips the divs out. i
> haven't written one yet, but i'm close.
>
>
> -- bruce (sqlwork.com)
>
>
>
> "Thor W Hammer" <(E-Mail Removed)> wrote in message
> news:437146df$(E-Mail Removed)...
>> In ASP.NET 2.0, it seems to wrap a div around the hidden form fields such
>> as
>> __ViewState. How do you override this rendering?
>>
>>

>
>



 
Reply With Quote
 
Erik Funkenbusch
Guest
Posts: n/a
 
      11-09-2005
On Wed, 9 Nov 2005 01:46:21 +0100, Thor W Hammer wrote:

> In ASP.NET 2.0, it seems to wrap a div around the hidden form fields such as
> __ViewState. How do you override this rendering?


Viewstate is enclosed in a DIV because that's required to produce valid
XHTML markup. inline elements (ie, input fields) must be enclosed in a
block level element in order to be valid.
 
Reply With Quote
 
intrader
Guest
Posts: n/a
 
      11-10-2005
On Tue, 08 Nov 2005 21:03:47 -0500, Greg Burns wrote:

> http://www.aspnetpro.com/newslettera...200511de_l.asp
>
> "ASP.NET 2.0 defaults to XHTML 1.1, but you can also opt for XHTML 1.0
> Strict or Transitional. The rendering engine of some controls has been
> reworked to make them produce compliant output. As a result, in ASP.NET 2.0,
> each control's markup includes a closing tag. Furthermore, the viewstate
> hidden field comes surrounded by a <div> tag and the form is only identified
> by the ID attribute."
>
> Sounds like they did this for a reason.
>
> Greg
>
>
> "Bruce Barker" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> please report it as a bug if enough of us do, maybe MS will fix it (it
>> causes all kinds of layout problems).
>>
>> the only fix is a post processing httphandler that strips the divs out. i
>> haven't written one yet, but i'm close.
>>
>>
>> -- bruce (sqlwork.com)
>>
>>
>>
>> "Thor W Hammer" <(E-Mail Removed)> wrote in message
>> news:437146df$(E-Mail Removed)...
>>> In ASP.NET 2.0, it seems to wrap a div around the hidden form fields such
>>> as
>>> __ViewState. How do you override this rendering?
>>>
>>>

>>
>>

It seems to me that the XTHML schema allows hidden fields inside form
elements. So why do we need the div?. Check the generated (rendered)
XHTML and verify that the div is there. I have seen posts that indicate
that the div is not there, but that some controls are followed by a
carriage return. This carriage return would be ignored by any good
browser.
It will definetelly create layout problems as it is a block
element. So is this a problem with ASP.NET 2.0?


 
Reply With Quote
 
Erik Funkenbusch
Guest
Posts: n/a
 
      11-10-2005
On Thu, 10 Nov 2005 02:31:10 GMT, intrader wrote:

> On Tue, 08 Nov 2005 21:03:47 -0500, Greg Burns wrote:
> It seems to me that the XTHML schema allows hidden fields inside form
> elements. So why do we need the div?


No. While it's true that hidden fields have to be inside form elements to
be posted, it has nothing to do with form elements per se. The problem is
that input elements are inline elements, and inline elements must be
contained in block elements.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To wrap or not to wrap? Aaron Fude Java 12 05-10-2008 06:33 PM
Wrap computer components in bubble wrap? Ickshka Computer Support 7 05-05-2006 05:54 PM
DIV wrapped around hidden fields? Rocky Moore ASP .Net 2 11-03-2005 02:52 PM
Border lines in hidden div bleed through into visible div Jon Javascript 2 05-07-2004 04:06 PM
Netscape hidden fields - array - multiple fields with same name mark.reichman@rl.af.mil Javascript 0 07-17-2003 03:05 PM



Advertisments