471,354 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Why do PostBacks Work with JavaScript Disabled

Just doing some testing here to see what happens when JavaScript is
disabled. I was told somewhere along the line that PostBacks would fail
because they rely on javascript:
function __doPostBack(eventTarget, eventArgument) {...

But my page is still posting back just fine with JavaScript disabled (while
other JavaScript-dependent features are totally broken).

So, how do PostBacks still happen?

Thanks!
Nov 19 '05 #1
1 4860
> Just doing some testing here to see what happens when JavaScript is
disabled. I was told somewhere along the line that PostBacks would fail
because they rely on javascript:
function __doPostBack(eventTarget, eventArgument) {...

But my page is still posting back just fine with JavaScript disabled
(while other JavaScript-dependent features are totally broken).

So, how do PostBacks still happen?


When a browser sends a request for a page to ASP.Net, the system will
inspect the headers to see if Javascript is allowed.

This happens before the form comes down to the client. Remember that
ASP.Net is writing the code that the browser uses.

If Javascript is allowed, then the code and HTML that is emitted uses
Javascript. If not, ASP.Net will emit different HTML code so that your page
will use traditional form POST.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Alan Silver | last post: by
5 posts views Thread by narmathabala | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.