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. Problem getting client side value in server side

Problem getting client side value in server side

Scheduled Pinned Locked Moved ASP.NET
sysadmintoolshelptutorial
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.
  • C Offline
    C Offline
    CrazyCoder26
    wrote on last edited by
    #1

    Hi I am populating a Dropdownlist using clientside script.Later, when I am trying to access the dropdownvalue from server side code,it's coming blank. I have tried the following:

             string val=DropDownList1.Text;
    

    I have also tried

             string val=DropDownList1.Attributes\["value"\];
    

    But none worked. Please guide me to solve this.

    CC26

    L 1 Reply Last reply
    0
    • C CrazyCoder26

      Hi I am populating a Dropdownlist using clientside script.Later, when I am trying to access the dropdownvalue from server side code,it's coming blank. I have tried the following:

               string val=DropDownList1.Text;
      

      I have also tried

               string val=DropDownList1.Attributes\["value"\];
      

      But none worked. Please guide me to solve this.

      CC26

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

      If you are populating the Dropdown using client side script(JavaScript), then you cannot read dropdown value at server. Dropdown clears when page post back. If you need to read the value, save the selected value of dropdown into the hidden text box, using JavaScript(Before Page Post Back). Now read the textbox value.

      Regards Aman Bhullar www.arlivesupport.com[^]

      C 1 Reply Last reply
      0
      • L Lost User

        If you are populating the Dropdown using client side script(JavaScript), then you cannot read dropdown value at server. Dropdown clears when page post back. If you need to read the value, save the selected value of dropdown into the hidden text box, using JavaScript(Before Page Post Back). Now read the textbox value.

        Regards Aman Bhullar www.arlivesupport.com[^]

        C Offline
        C Offline
        CrazyCoder26
        wrote on last edited by
        #3

        Thanks Aman ....that's a great n working reply....even i was also thinking of the same solution.

        CC26

        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