Why do PostBacks Work with JavaScript Disabled

Discussion in 'ASP .Net' started by Frankie, Oct 8, 2005.

  1. Frankie

    Frankie Guest

    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!
    Frankie, Oct 8, 2005
    #1
    1. Advertising

  2. > 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.
    --
    Nick Malik [Microsoft], Oct 8, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryan Breakspear
    Replies:
    0
    Views:
    428
    Ryan Breakspear
    Nov 18, 2003
  2. Steve Murphy
    Replies:
    3
    Views:
    450
    Eliyahu Goldin
    Aug 7, 2005
  3. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    853
    Mark Rae
    Dec 21, 2006
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,736
    Smokey Grindel
    Dec 2, 2006
  5. Replies:
    0
    Views:
    432
Loading...

Share This Page