473,406 Members | 2,273 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,406 software developers and data experts.

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

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?
Nov 19 '05 #1
5 1710
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" <th*********@hotmail.com> wrote in message
news:43********@news.broadpark.no...
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?

Nov 19 '05 #2
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" <br******************@safeco.com> wrote in message
news:uR*************@TK2MSFTNGP10.phx.gbl...
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" <th*********@hotmail.com> wrote in message
news:43********@news.broadpark.no...
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?


Nov 19 '05 #3
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.
Nov 19 '05 #4
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" <br******************@safeco.com> wrote in message
news:uR*************@TK2MSFTNGP10.phx.gbl...
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" <th*********@hotmail.com> wrote in message
news:43********@news.broadpark.no...
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?
Nov 19 '05 #5
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.
Nov 19 '05 #6

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

Similar topics

10
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one...
1
by: mark.reichman | last post by:
First off.. Thanks to Grant Wagner for help in a previous thread related to this one. I am at a total loss... I have multiple fields in a form with the same name. Lets call the fields with the...
1
by: MichaelC | last post by:
Hi all, I'm a newbie to SQL and I need help with investigating what ways are possible to build an interface of some sort that wraps around a SQL query script. I have a simple SQL query which...
1
by: Sam Wuebben | last post by:
I would like to add a few hidden field values to a form as it is submited via JavaScript. I have a static page shopping site that uses MIVA shopping cart. Some of the pages are getting quite...
9
by: Randell D. | last post by:
Folks, I have a large amount of values to store (we're talking tens, if not hundreds of bytes). I need this for a client side application - ignore the security consequences for the moment -...
8
by: John | last post by:
Hello. I have a search form for music albums which among other things I need to search all the song titles of the song. Normally in a search form I would have checkboxes the user can use to...
5
by: NTE | last post by:
Access 2000, My application has a main form that the users interact with. There are 2 hidden fields. When they select "filter by form" from the menu, the hidden fields become visble. Is...
1
by: petersk | last post by:
Firstly I am an older person trying to teach myself to create a project and teach myself Access VBA programming along the way. I anticipate a number of problems I will need help with but here...
0
by: BcNexus | last post by:
Hello all, The search function of this forum isn't working although I found a similar question on the forum using Google, but the replies don't help me. So, forgive me please if this has been...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.