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
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to stop postback of asp button which is havin client side and serverside events....

how to stop postback of asp button which is havin client side and serverside events....

Scheduled Pinned Locked Moved ASP.NET
sysadminhelptutorialquestionannouncement
6 Posts 6 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.
  • T Offline
    T Offline
    tanvi1508
    wrote on last edited by
    #1

    I have a page where i have some client side validations on a button click and also some serverside event. I am using a asp button. I know its doing some server events so postback will occur but is there anyway i can stop that postback? Or do i have to use update panel of ajax only..But I prefer not to use this since it postsback but doesnt show its postbacking!! Please do help

    M V D C S 5 Replies Last reply
    0
    • T tanvi1508

      I have a page where i have some client side validations on a button click and also some serverside event. I am using a asp button. I know its doing some server events so postback will occur but is there anyway i can stop that postback? Or do i have to use update panel of ajax only..But I prefer not to use this since it postsback but doesnt show its postbacking!! Please do help

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      If you want to have some server side code which should be executed than it will definitely do a Postback. In this case, you should make use of AJAX.

      Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      1 Reply Last reply
      0
      • T tanvi1508

        I have a page where i have some client side validations on a button click and also some serverside event. I am using a asp button. I know its doing some server events so postback will occur but is there anyway i can stop that postback? Or do i have to use update panel of ajax only..But I prefer not to use this since it postsback but doesnt show its postbacking!! Please do help

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        user UpdatePanel to avoid that

        Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

        1 Reply Last reply
        0
        • T tanvi1508

          I have a page where i have some client side validations on a button click and also some serverside event. I am using a asp button. I know its doing some server events so postback will occur but is there anyway i can stop that postback? Or do i have to use update panel of ajax only..But I prefer not to use this since it postsback but doesnt show its postbacking!! Please do help

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #4

          How about ICallbackEventHandler[^]?

          1 Reply Last reply
          0
          • T tanvi1508

            I have a page where i have some client side validations on a button click and also some serverside event. I am using a asp button. I know its doing some server events so postback will occur but is there anyway i can stop that postback? Or do i have to use update panel of ajax only..But I prefer not to use this since it postsback but doesnt show its postbacking!! Please do help

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            If you want to stop a postback, return 'false' on the client side event. Of course, if you stop postback, then your server side code won't run. If you want the server side code to run without any sort of postback, not even AJAX, then you are seriously deluded and need to give up until you've read some basic books, that would make your question retarded. If you want to stop the server side code from running based on a condition in the client side code, just return false to stop the postback.

            Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

            1 Reply Last reply
            0
            • T tanvi1508

              I have a page where i have some client side validations on a button click and also some serverside event. I am using a asp button. I know its doing some server events so postback will occur but is there anyway i can stop that postback? Or do i have to use update panel of ajax only..But I prefer not to use this since it postsback but doesnt show its postbacking!! Please do help

              S Offline
              S Offline
              satigar123
              wrote on last edited by
              #6

              hi in javascript validation function write return false so it stops the page excution

              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