Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DropDownList 'Please select' text

Posted on 2009-07-09
4
Medium Priority
?
271 Views
Last Modified: 2013-11-08
I have an ASP DropDownList and I would like to add an Item which reads 'Please Select'. However I don't want the user to be able to select the 'Please Select' item (it would just be for show).

Is this possible
0
Comment
Question by:Mr_Shaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 9

Accepted Solution

by:
Deathrace earned 672 total points
ID: 24814887
You can add an item "Please Select" but i'm not sure whether we cann't select it. Try a sever-side validation, using dropdownlist.selectedtext to identify the items.
if its equal to "Please Select" do nothing
else
do something
0
 
LVL 15

Assisted Solution

by:jinal
jinal earned 664 total points
ID: 24814890
You can put javascript validation for that.

As you are using ASP.net you can use required field validation for that.

<asp:RequiredFieldValidator ID="valid1" runat="server" ControlToValidate="drpDropDown" InitialValue="Please select" />
0
 
LVL 15

Assisted Solution

by:spprivate
spprivate earned 664 total points
ID: 24814942
Try this
dropdownlist.Items(0).Enabled = False
0
 

Author Closing Comment

by:Mr_Shaw
ID: 31601660
thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question