More in this section

Forums / Developing with Sitefinity / Disable ViewState and W3C Validation

Disable ViewState and W3C Validation

5 posts, 0 answered
  1. Ruben Herrera
    Ruben Herrera avatar
    38 posts
    Registered:
    10 Jul 2009
    18 Mar 2010
    Link to this post
    Hi all,

    How I can disable Viewstate completely? I have followed instructions here: http://www.sitefinity.com/support/forums/sitefinity-3-x/deployment/disable-viewstate.aspx and set to false in page properties but still there:

    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUENTM4MWQYA

    Another question:
    Pages not validate W3C because Sitefinity add name property to a form in the top page:
    <form name="aspnetForm" method="po
    Is there anyway to fix it? Is it related toViewstate?

    Thanks!!
    Rubén
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    19 Mar 2010
    Link to this post
    Hello Ruben Herrera,

    Thank your for posting your question. 

    The ViewState cannot be disabled completely - while there is an option for that, it does disable most of the controls state. There are some controls and variables though which should keep their state between the postbacks, and the ViewState is the best option here. 

    As for the form and the validation, could you please provide us with live url to the page that does not validate? Since the form you are showing is the standard asp.net form - there is no way to remove it - every asp.net application has it. There might be other html elements before it though, which prevent the validation. 

    Thank you in advance. 

    Kind regards,
    Georgi
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Ruben Herrera
    Ruben Herrera avatar
    38 posts
    Registered:
    10 Jul 2009
    19 Mar 2010
    Link to this post
    Hi,

    Thanks for answer, I see it more clearly about ViewState.

    Unfortunately  page is still in develop for now, I dont have live url  but I can post you page definitions:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    And W3C validator output, 1 error(I use "Validation by Direct Input"):
    Line 23, Column 12: there is no attribute "name"
     
    <form name="aspnetForm" method="post" action="Register_Section" id…
     
     
    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
     
    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
     
    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

    Error is fixed removing "name" atribute.

    Regards.
    Rubén
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    19 Mar 2010
    Link to this post
    Hello Ruben Herrera,

    Thanks for the follow up. 

    To use Asp.Net with XHTML 1.0 strict / DTD, you need to update your web.config file with the following:

    <system.web>
        <xhtmlConformance mode="Strict" />
    </system.web>
    You can find more about the xhtml compliance settings here - http://msdn.microsoft.com/en-us/library/ms178159.aspx

    This will force Asp.Net to render the pages so their are compatible. 

    Let me know if you have any other questions. 

    Sincerely yours,
    Georgi
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Ruben Herrera
    Ruben Herrera avatar
    38 posts
    Registered:
    10 Jul 2009
    19 Mar 2010
    Link to this post
    Great, It´s works!

    Thanks
    Rubén
Register for webinar
5 posts, 0 answered