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

Change __VIEWSTATE to something else

Is it possible to change the __VIEWSTATE id?
The reason is we shouldn't have any id starting with underscores on
XHTML pages.

Thank you
Jun 27 '08 #1
6 1684
re:
!The reason is we shouldn't have any id starting with underscores on XHTML pages.

Who told you that ?
IDs starting with *double* underscores are perfectly acceptable in XHTML.

Check the validity of my ASP.NET FAQ's pages :

http://asp.net.do/faq/default.aspx

Here's the link to the W3C's validator :
http://validator.w3.org/check?uri=ht...Inline&group=0

Here's the response by the W3C's validator: "This Page Is Valid XHTML 1.0 Transitional!"

Now, check "View Source" for that page, and see that the page *does* include a "__VIEWSTATE" id :

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUKMTA1MDI3ODMwMWRkjOh6z8CUeDcuYjV3L6BQzzSZL7Q =" />

The key, of course, is that "__VIEWSTATE" has TWO underscores. <g>


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Ivan Gasparetto" <iv************@gmail.comwrote in message
news:16**********************************@w7g2000h sa.googlegroups.com...
Is it possible to change the __VIEWSTATE id?
The reason is we shouldn't have any id starting with underscores on
XHTML pages.

Thank you

Jun 27 '08 #2
yes, you have two options:

1) switch to MVC which doesn't generate any any viewstate or unwanted markup.

2) override PageStatePersister and create your own hidden field. google for
examples.

-- bruce (sqlwork.com)
"Ivan Gasparetto" wrote:
Is it possible to change the __VIEWSTATE id?
The reason is we shouldn't have any id starting with underscores on
XHTML pages.

Thank you
Jun 27 '08 #3
Bruce, why override, if ID's which start with an underscore are perfectly acceptable in XHTML ?

See my just-sent reply to Ivan.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:1F**********************************@microsof t.com...
yes, you have two options:

1) switch to MVC which doesn't generate any any viewstate or unwanted markup.

2) override PageStatePersister and create your own hidden field. google for
examples.

-- bruce (sqlwork.com)
"Ivan Gasparetto" wrote:
>Is it possible to change the __VIEWSTATE id?
The reason is we shouldn't have any id starting with underscores on
XHTML pages.

Thank you

Jun 27 '08 #4
"Ivan Gasparetto" <iv************@gmail.comwrote in message
news:16**********************************@w7g2000h sa.googlegroups.com...
Is it possible to change the __VIEWSTATE id?
The reason is we shouldn't have any id starting with underscores on
XHTML pages.
Google around and you'll find it's valid... however the FORM NAME attribute
is not. There is something you can add to webconfig to make ASP.NET generate
XHTML compliant output...
<system.web>
<!-- other elements here -->
<xhtmlConformance
mode="Strict" />
</system.web>

Copied form http://msdn.microsoft.com/en-us/libr...59(VS.80).aspx

Jun 29 '08 #5
The reason is we shouldn't have any id starting with underscores on XHTML
pages.
Who told you that ?
R: ISO and the W3C did!
http://www.w3.org/TR/2000/WD-xml-2e-20000814#charsets

Kind regards,
Ivan

Jul 16 '08 #6
__VIEWSTATE starts with TWO underscores...and it's perfectly valid.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Ivan Gasparetto" <Ivan Ga********@discussions.microsoft.comwrote in message
news:7D**********************************@microsof t.com...
The reason is we shouldn't have any id starting with underscores on XHTML pages.
Who told you that ?
R: ISO and the W3C did!
http://www.w3.org/TR/2000/WD-xml-2e-20000814#charsets

Kind regards,
Ivan

Jul 17 '08 #7

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

Similar topics

2
by: J. Johnson | last post by:
Is it possible use viewstate to detect if a form's data has changed? I want to prevent duplicate submission of data. Example: On_click event of Submit button: 1. Save viewstate to session....
2
by: Me | last post by:
Is there anyway to control the style/layout of this field? ..NET doesn't generate an ID for it so you can create a style for it or manipulate it in code. I've looked on MSDN etc. but can't...
10
by: Greg Phillips | last post by:
I have a page, with an iframe in it. the iframe loads up another ASPX page, I have set both pages enableviewstate=false The problem is, if I click on anything on the main page, it gives me a...
10
by: Jason Pettys | last post by:
I have an ASP.NET page that my client wants to e-mail. So in IE we choose File > Send > Page by E-mail, which opens up either Outlook or Outlook Express with the HTML page content as the message...
2
by: GTi | last post by:
I have a ASP 2.0 page where I use some Ajax code. The Ajax code (JavaScript) is inserted from CodeBehind. In my page I have a submit button and some links for Ajax functions. When I load the page...
0
by: msnews.microsoft.com | last post by:
I have been raking my brains on why this does not work. I get back the same login screen again instead of the home page redirection which should occur after a successful login: 'create a cookie...
1
by: Eric | last post by:
Hello, I was testing my application on my localhost, when I View Source, I see the __VIEWSTATE and its only small in size (about 500 bytes). When I copy this same application over to our IIS...
0
by: reju | last post by:
Hi, I am not using view state.I disabled the view state, but this hidden __VIEWSTATE variable and some text is coming when we are taking the view source.Is there any way to remove this variable?...
7
by: reju | last post by:
Hi, I am not using view state.I disabled the view state, but this hidden __VIEWSTATE variable and some text is coming when we are taking the view source.Is there any way to remove this variable?...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.