0

when I am disable dropdownlist using js, and then I access from .cs page. It gives o value even there is one item is selected..

I want to disable dropdownlist but at the same I want to access its selected value as well

Cœur
  • 37,241
  • 25
  • 195
  • 267
user1001101
  • 172
  • 1
  • 3
  • 8

2 Answers2

0

You cant access the disabled items from Code behind.

Disabled form values will not be sent in post data.

Check this post

Disabled form fields not submitting data

If you need add some css techniques like opacity and do.

Community
  • 1
  • 1
Murali Murugesan
  • 22,423
  • 17
  • 73
  • 120
  • You should either enable the dropdown before posting your data to server or use hidden controls to hold data of your disabled dropdown. – user1001101 Dec 14 '12 at 12:05
0

Try to add selected value of dropdown in hidden field, and access value from hidden field.

Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
Manibhadra
  • 400
  • 4
  • 6
  • Thanks for your comments . But I have used selected value in many multiple locations for different calculation.. So it is very hard to change at all the location and test all scenarios again.. so if any other solution of this problem would great for me . Thanks in advance – user1001101 Dec 14 '12 at 11:45