• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2537
  • Last Modified:

Dropdownlist box readonly

How Can I make dropdownlist box readonly on the webpage on certain conditions

Thanks
0
jra2002
Asked:
jra2002
  • 2
1 Solution
 
jnhorstCommented:
C#:
if (someCondition)  dropDownList.Attributes.Add("readonly", "true");

VB.NET

If someCondition Then dropDownList.Attributes.Add("readonly", "true")

John
0
 
jra2002Author Commented:
It is not working this syntax what you suggested,

I had fixed it with

dropdownlist.Enabled = False
0
 
jnhorstCommented:
OK... Enabled/Disabled is a different property than "readonly", but that's fine.  Good that you got it working!

John
0
 
ee_ai_constructCommented:
Closed, 20 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Moderator
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now