Please refer this code
HTML
<script type="text/javascript">
$(function () {
$('[id*=ddlCities]').focusout(function () {
var isValid = CheckDropDownListValue($(this).val());
if (!isValid) {
alert('Please Select City Name');
}
});
$('[id*=btnSave]').click(function () {
var isValid = CheckDropDownListValue($("[id*=ddlCities]").val());
if (!isValid) {
alert('Please Select City Name');
}
});
});
function CheckDropDownListValue(value) {
if (value == "") {
return false;
}
else {
return true;
}
}
</script>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
Name
</td>
<td>
<asp:TextBox ID="txtName" runat="server" />
</td>
</tr>
<tr>
<td>
City
</td>
<td>
<asp:DropDownList ID="ddlCities" runat="server">
<asp:ListItem Text="" Value="" />
<asp:ListItem Text="Mumbai" Value="Mumbai" />
<asp:ListItem Text="Delhi" Value="Delhi" />
</asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="btnSave" runat="server" Text="Save" />
</td>
</tr>
</table>
DEMO
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
body
{
font-family: Arial;
font-size: 10pt;
}
table
{
border: 1px solid #ccc;
}
table th
{
background-color: #F7F7F7;
color: #333;
font-weight: bold;
}
table th, table td
{
padding: 5px;
border-color: #ccc;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#ddlCities').focusout(function () {
var isValid = CheckDropDownListValue($(this).val());
if (!isValid) {
alert('Please Select City Name');
}
});
$('#btnSave').click(function () {
var isValid = CheckDropDownListValue($("#ddlCities").val());
if (!isValid) {
alert('Please Select City Name');
}
});
});
function CheckDropDownListValue(value) {
if (value == "") {
return false;
}
else {
return true;
}
}
</script>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
Name
</td>
<td>
<input name="txtName" type="text" id="txtName" />
</td>
</tr>
<tr>
<td>
City
</td>
<td>
<select name="ddlCities" id="ddlCities">
<option value=""></option>
<option value="Mumbai">Mumbai</option>
<option value="Delhi">Delhi</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" name="btnSave" value="Save" id="btnSave" />
</td>
</tr>
</table>
</body>
</html>
Demo