I create a dropdown list by using ASP.NET MVC helper like this,
<%=Html.DropDownList("Group","-please select a group-")%>
and I get the html like this,
<label for="GroupId">Group:</label>
<select id="GroupId" name="GroupId"><option value="">-please select a group-</option>
<option value="15">Business</option>
<option value="16">Friends</option>
<option value="17">Others</option>
</select>
The default option is "-please selecta group-" and the value is empty.
How can I validate the select value to see if it's empty? I mean if user doesn't choose a group, how can I know it and give user a error message. Now, the code only shows exception error, because the value is empty for the default option.