Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Handling AutoPostback without Javascript Support

Handling AutoPostback without Javascript Support

Scheduled Pinned Locked Moved ASP.NET
javascriptsysadminai-codinghelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Atul Kale
    wrote on last edited by
    #1

    Hi Pals, I am facing a problem in working with some Server Side events of controls () like CheckBox, RadioButton, LinkButton, DropDownList. To elaborate, I would say, since to handle the events like SelectedIndexChanged of DropDownlist on Server Side, we usually set the AutoPostback property to TRUE. Well, this ends up in a javascript code generation with the Response to the Web Client. But If the Javascript is not enabled (or not supported), then this doesn't work. there is my problem. I have to implement the entire site, with **minimal (None if possible), support of javascript.**Please suggest a solution for this. Thanx! Atul Kale MCSD, MCT Sr. Software Engineer XcelVision Technologies Ltd.

    H 1 Reply Last reply
    0
    • A Atul Kale

      Hi Pals, I am facing a problem in working with some Server Side events of controls () like CheckBox, RadioButton, LinkButton, DropDownList. To elaborate, I would say, since to handle the events like SelectedIndexChanged of DropDownlist on Server Side, we usually set the AutoPostback property to TRUE. Well, this ends up in a javascript code generation with the Response to the Web Client. But If the Javascript is not enabled (or not supported), then this doesn't work. there is my problem. I have to implement the entire site, with **minimal (None if possible), support of javascript.**Please suggest a solution for this. Thanx! Atul Kale MCSD, MCT Sr. Software Engineer XcelVision Technologies Ltd.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      There is no solution. HTML does not define automatic browser-handled events except for <input type="submit"> and <intput type="reset"> (as far as controls go). So, unless the event is handled by client-side script (since server-side script is not an issue once the browser has the page), there is no possible way to accomplish this. Workarounds could include having a button next to each combo, etc., that submits the changes (though have autopostback for people that aren't overly paranoid). You could also just inform the user that JavaScript has to enabled past a certain point. Many sites - especially government sites where the "webmasters" don't know crap about design and browser compatibility - do this. The other option would be to have two pages, having the "light" one detect for the presence of JavaScript and forwarding the browser to the "heavy" one (this could be done with one call, since location.href = 'new url'; assumes that JavaScript is there since it is required to work).

      -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

      A 1 Reply Last reply
      0
      • H Heath Stewart

        There is no solution. HTML does not define automatic browser-handled events except for <input type="submit"> and <intput type="reset"> (as far as controls go). So, unless the event is handled by client-side script (since server-side script is not an issue once the browser has the page), there is no possible way to accomplish this. Workarounds could include having a button next to each combo, etc., that submits the changes (though have autopostback for people that aren't overly paranoid). You could also just inform the user that JavaScript has to enabled past a certain point. Many sites - especially government sites where the "webmasters" don't know crap about design and browser compatibility - do this. The other option would be to have two pages, having the "light" one detect for the presence of JavaScript and forwarding the browser to the "heavy" one (this could be done with one call, since location.href = 'new url'; assumes that JavaScript is there since it is required to work).

        -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

        A Offline
        A Offline
        Atul Kale
        wrote on last edited by
        #3

        Thanx Heath! U R Right there! Its hell of a job to convince the Client all these issues. I'll try to convince the use of javascript in this case. cauz anyways, the workaround was always an option for backup! regards Atul Kale MCSD, MCT netdecisions Ltd.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups