Solved

asp .net dropdown list check

Posted on 2008-10-30
4
589 Views
Last Modified: 2013-12-17
I have a dropdown list and would like to know in the code behind if any item is selected from this dropdown list. If nothing is selected, I will be using a database value. How do I check that? Thanks,

c#, asp.net
0
Comment
Question by:rajeevcs
[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 4

Accepted Solution

by:
sijishJohn earned 250 total points
ID: 22839658
try this..

if (DropDownList1.SelectedItem == null)
{

}
0
 

Assisted Solution

by:dhiraj79
dhiraj79 earned 250 total points
ID: 22842315
Add First Item as --Select-- in drop down list of Items by using edit Item  

Now check for
if (DropDownList1.SelectedValue == "--Select--")
{
 // Means nothing is selected.
}
else
{
//Something is selected.
}
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

696 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