Retrieve value from hidden/disabled DropDownList?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cipher

    Retrieve value from hidden/disabled DropDownList?

    I've got a DropDownList control on my ASP.Net page and I cannot retrieve
    it's value (via its SelectedValue property) if the control is hidden or
    disabled. Once I set the control to visible and enabled then the currently
    selected value is available in code.

    Any ideas how I can hide or disable a DropDownList but still retrieve its
    value as I don't want the users to be able to directly change its value.

    Thanks in advance.



  • Natty Gur

    #2
    Re: Retrieve value from hidden/disabled DropDownList?

    Hi,

    you should set control visibility style to hidden :

    XXX.Style["visibility "] = "hidden";

    HTH

    Natty Gur[MVP]

    blog : http://weblogs.asp.net/ngur
    Mobile: +972-(0)52-8888377


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    Working...