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. Open popup window on selectedIndexChange of "asp:dropdownlist"

Open popup window on selectedIndexChange of "asp:dropdownlist"

Scheduled Pinned Locked Moved ASP.NET
helpjavascriptsysadminquestion
5 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.
  • D Offline
    D Offline
    deep7
    wrote on last edited by
    #1

    Hi, In my application i have a "asp:dropdownlist" control on whose selectedIndexChange event i need to call a javascript function. But i get build error:Too many characters in character literal. If i remove 'runat=s"server" then its doesn't give build error, but on load of page, it doesn't show the control. Spanish Turkish English What can i do get rid of the build error, n for the javascript code to get executed successfully? Could anyone plz help? Thanks

    I S 2 Replies Last reply
    0
    • D deep7

      Hi, In my application i have a "asp:dropdownlist" control on whose selectedIndexChange event i need to call a javascript function. But i get build error:Too many characters in character literal. If i remove 'runat=s"server" then its doesn't give build error, but on load of page, it doesn't show the control. Spanish Turkish English What can i do get rid of the build error, n for the javascript code to get executed successfully? Could anyone plz help? Thanks

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      use onClick event instead of OnSelectedIndexChanged Best Regard Pathan

      GOD HELP THOSE WHO HELP THEMSELVES

      D 1 Reply Last reply
      0
      • I Imran Khan Pathan

        use onClick event instead of OnSelectedIndexChanged Best Regard Pathan

        GOD HELP THOSE WHO HELP THEMSELVES

        D Offline
        D Offline
        deep7
        wrote on last edited by
        #3

        there is no 'onclick' event for an "asp:dropdownlist" and i need to show popup when user selects an item from the dropdownlist only..not on click of dropdownlist

        1 Reply Last reply
        0
        • D deep7

          Hi, In my application i have a "asp:dropdownlist" control on whose selectedIndexChange event i need to call a javascript function. But i get build error:Too many characters in character literal. If i remove 'runat=s"server" then its doesn't give build error, but on load of page, it doesn't show the control. Spanish Turkish English What can i do get rid of the build error, n for the javascript code to get executed successfully? Could anyone plz help? Thanks

          S Offline
          S Offline
          szukuro
          wrote on last edited by
          #4

          The OnSelectedIndexChanged is server event and not suitable for your purposes. The client-side event you are looking for is onchange. So in the codebehind write: ddlListSelect.Attributes.Add("onchange", "javascript:openPopupNew('frmPopup.aspx')");

          D 1 Reply Last reply
          0
          • S szukuro

            The OnSelectedIndexChanged is server event and not suitable for your purposes. The client-side event you are looking for is onchange. So in the codebehind write: ddlListSelect.Attributes.Add("onchange", "javascript:openPopupNew('frmPopup.aspx')");

            D Offline
            D Offline
            deep7
            wrote on last edited by
            #5

            Thanks :)

            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