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. post back

post back

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorialquestion
8 Posts 3 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.
  • P Offline
    P Offline
    papa1980
    wrote on last edited by
    #1

    hello I have one ddl("DropDownlist") and i whant it to execude some function befoure is change index how to do that??? pleas help me

    R 1 Reply Last reply
    0
    • P papa1980

      hello I have one ddl("DropDownlist") and i whant it to execude some function befoure is change index how to do that??? pleas help me

      R Offline
      R Offline
      russellsoft
      wrote on last edited by
      #2

      This function must run at client or at server?

      P 1 Reply Last reply
      0
      • R russellsoft

        This function must run at client or at server?

        P Offline
        P Offline
        papa1980
        wrote on last edited by
        #3

        on server

        R 1 Reply Last reply
        0
        • P papa1980

          on server

          R Offline
          R Offline
          russellsoft
          wrote on last edited by
          #4

          View state attaches after page load... Old and new View states are comparing and generated events of index changing... You can add to your page HtmlInputHidden control and on client on oncange event write selected index into value of hiddenfield... On server you can save in indexchange event of ddl into some variable... Then on Page_Load (in the end of it) you can compare saved index and value of HtmlInputHidden control... If they are different that you must run your function... So you will run this function before indexchange event on server...

          P 1 Reply Last reply
          0
          • R russellsoft

            View state attaches after page load... Old and new View states are comparing and generated events of index changing... You can add to your page HtmlInputHidden control and on client on oncange event write selected index into value of hiddenfield... On server you can save in indexchange event of ddl into some variable... Then on Page_Load (in the end of it) you can compare saved index and value of HtmlInputHidden control... If they are different that you must run your function... So you will run this function before indexchange event on server...

            P Offline
            P Offline
            papa1980
            wrote on last edited by
            #5

            how to done event indexchanging

            R 1 Reply Last reply
            0
            • P papa1980

              how to done event indexchanging

              R Offline
              R Offline
              russellsoft
              wrote on last edited by
              #6

              I didn't understand, what you mean? I wrote 'indexchange' - I mean SelectedIndexChanged event on Server 'onchange' - The same event on client (using JavaScript)

              P 1 Reply Last reply
              0
              • R russellsoft

                I didn't understand, what you mean? I wrote 'indexchange' - I mean SelectedIndexChanged event on Server 'onchange' - The same event on client (using JavaScript)

                P Offline
                P Offline
                papa1980
                wrote on last edited by
                #7

                yes i allrady have it.But i give u example i have printer namer Canon,Hp,Epson and models deskjet 600,500 .... but for example when i change cannon index to hp i still have it models for hp if i done one more changes i get hp i think is happen delay with one turn how to solve it???

                I 1 Reply Last reply
                0
                • P papa1980

                  yes i allrady have it.But i give u example i have printer namer Canon,Hp,Epson and models deskjet 600,500 .... but for example when i change cannon index to hp i still have it models for hp if i done one more changes i get hp i think is happen delay with one turn how to solve it???

                  I Offline
                  I Offline
                  Ista
                  wrote on last edited by
                  #8

                  the value doesnt change until after the postback event runs through. Then your select index changed event is fired and the valueis changed then. like he said. do MyControl.Attributes.Add("onchange","javascript: document.getElementByID('MyHiddenControl').text = document.GetElementByID('MyControl').text;"); then in Page load you can access its value through the hidden control 1 line of code equals many bugs. So don't write any!!

                  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