Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I got surprised when I visited some sites with an 'aspx' extension at the end of their URLs and when I looked at their html source I didn't see any view state like the follwing:

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="SNIKalxBOk0/lp+SgXklgi/0/IUoRXTjEjp6NrL2ColFXGht1bTDit5V+wHdkcuM3YVmVNKG1jpM6zAg+MQCnvPDvlEvK8RNwHblq8NN1Ys=" />

How did they prevent this to happen? even if you turn the view state off you'll get at least of of the above input in your HTML output.

Here is one of the examples that I looked at: http://www.ada.org/index.aspx

share|improve this question
1  
See How do I turn off viewstate for good? –  MainMa Aug 28 '13 at 8:50

2 Answers 2

up vote 2 down vote accepted

The site, or at least the pages I clicked on, are almost certainly not using WebForms. One of the key give-aways is the complete lack of a single top-level form such as:

<body>
   <form method="post" action="/">

That combined with the lack of __VIEWSTATE and __EVENTTARGET and __EVENTARGUMENT hidden inputs seems fairly conclusive. However looking at the HTML for the site the following jumps out at me:

<span id="ADASlideShow1_rptSlideshow_ctl03_lblVideoType" style="display: none;">None</span>

The id is typical webforms output so this would suggest that either:

  • They have ported an ASP.NET WebForms site over to some other technology (possibly just plain HTML contained in a .aspx file - as the previous poster mentioned the functionality seems to be done using Flash and jQuery) and retained the HTML structure and ids in order to keep the CSS and Javascript in working condition.

  • Or they are using ASP.NET WebForm controls but with all ViewState and control interactions turned off - however I'm fairly sure that without the top level form tag webform controls just won't work at all (however it's been a while since I did any webforms work so I could be proved wrong).

share|improve this answer
    
But why they could do that? Is it for 1-Performance? 2-Clean output? 3-or could it be they don't know much about Web Forms? –  Kaser Aug 28 '13 at 12:40
    
#3 seems more likely but its all conjecture really. I can imagine a scenario where a business loses its ASP.NET capabilities (perhaps a key developer leaves or their contract with a development agency expires) and they 'fix' the problem by replacing the functionality with the static HTML and then using Flash and jQuery to fill up the gaps. Either way I'm fairly confident that their is no web-forms code executing on those pages. –  Jon Malcolm Aug 28 '13 at 14:49
1  
@JonMalcolm -- I'd be shocked if it wasn't a typical webforms page behind the scenes. As long as you aren't taking any data back webforms pages will render and operate just fine without any viewstate or any other web forms support. –  Wyatt Barnett Aug 28 '13 at 15:24
    
It's been a while since I did any web-forms so I bow to your superior knowledge :) –  Jon Malcolm Aug 29 '13 at 7:38

They are using viewstate --- but it looks like they did disable it for the home page and some of the major landing pages, see http://www.ada.org/productguide/c/28/Caries-Detection-Systems for an example of a page with viewstate.

Really not too hard a trick to pull off if your site is largely a brochure site such as this one.

share|improve this answer
    
Yup. The pages with no interaction can turn it off without noticing any development trouble at all. I bet its an SEO concern for a site like this. –  Graham Aug 28 '13 at 15:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.