Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Webdropdown.CurrentValue contains garbarge chars
posted

Hi

I have a webdropdown with certain date values in it.

When I change the selected value and try to access it using .CurrentValue method it returns the value with certain control chars e.g. 2013%2f/07%2f/31. However, if the selection is not been changed the .CurrentValue contains the right value e.g. 2013/07/31

Why is this so? And how can I get the value in the selection after the selection is changed?

thanks

Adi

  • 8607
    Offline posted

    Hello Adi,

    I made a test project and I get the control characters too.

    It seems like some encoding or decoding is done to the value.  To work around this, I first tried to use HttpUtility.HtmlEncode() or HttpUtility.HtmlDecode(), but it didn't make any change.

    Instead, I used String.Replace to get the expected result:

    String value = WebDropDown1.CurrentValue;
    value = value.Replace("%2F", "/");

    I have attached my sample.  I hope it helps.


    Elizabeth Albert
    Localization Engineer 

    WebDropDownCurrentValue.zip