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. PostBack From javascript

PostBack From javascript

Scheduled Pinned Locked Moved ASP.NET
helpjavascript
7 Posts 4 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.
  • S Offline
    S Offline
    S Aijaz
    wrote on last edited by
    #1

    i need to call a function that is codebehind file from javascript. i did it by placing button on page and setting its height and width 1 px and call it from javascript. but i have one issue that is a small button is displayed on the page even if i give it left position -100. can u plz help.

    G L M 3 Replies Last reply
    0
    • S S Aijaz

      i need to call a function that is codebehind file from javascript. i did it by placing button on page and setting its height and width 1 px and call it from javascript. but i have one issue that is a small button is displayed on the page even if i give it left position -100. can u plz help.

      G Offline
      G Offline
      Gamzun
      wrote on last edited by
      #2

      Use __doPostBack in javascript. Google about it you'll lots of sample to understand. Please note Microsoft recommends to use GetPostBackEventReference instead of directly embedding __doPostBack, just google about it too.

      Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif

      S 1 Reply Last reply
      0
      • G Gamzun

        Use __doPostBack in javascript. Google about it you'll lots of sample to understand. Please note Microsoft recommends to use GetPostBackEventReference instead of directly embedding __doPostBack, just google about it too.

        Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif

        S Offline
        S Offline
        S Aijaz
        wrote on last edited by
        #3

        im using __doPostBack but my problem with that is that i need to give id of a control. i want to call a code behind function that is not handler to any control. i can use a button as well but problem with that is it becomes visible to user. even if i set left position to -100px. can i call function that is given below, or make button invisible to user even then call its handler from javascript. private void Test() { label1.Text = "Hello"; }

        1 Reply Last reply
        0
        • S S Aijaz

          i need to call a function that is codebehind file from javascript. i did it by placing button on page and setting its height and width 1 px and call it from javascript. but i have one issue that is a small button is displayed on the page even if i give it left position -100. can u plz help.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Try adding

          style="display:none"

          to the button. This may help you

          Regards Aman Bhullar www.arlivesupport.com[^]

          M 1 Reply Last reply
          0
          • L Lost User

            Try adding

            style="display:none"

            to the button. This may help you

            Regards Aman Bhullar www.arlivesupport.com[^]

            M Offline
            M Offline
            mithun narayanan
            wrote on last edited by
            #5

            put a hidden button in your page lets say "btnHidden" Set its style="display:none;" call btnhidden.Click(); in javascript watever code written in btnHidden's event will be excuted.. Hope this wil help.

            1 Reply Last reply
            0
            • S S Aijaz

              i need to call a function that is codebehind file from javascript. i did it by placing button on page and setting its height and width 1 px and call it from javascript. but i have one issue that is a small button is displayed on the page even if i give it left position -100. can u plz help.

              M Offline
              M Offline
              mithun narayanan
              wrote on last edited by
              #6

              put a hidden button in your page lets say "btnHidden" Set its style="display:none;" call btnhidden.Click(); in javascript watever code written in btnHidden's event will be excuted.. Hope this wil help...

              S 1 Reply Last reply
              0
              • M mithun narayanan

                put a hidden button in your page lets say "btnHidden" Set its style="display:none;" call btnhidden.Click(); in javascript watever code written in btnHidden's event will be excuted.. Hope this wil help...

                S Offline
                S Offline
                S Aijaz
                wrote on last edited by
                #7

                Thanx a lot every body for the help

                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