Dropdownlist validation in Asp.net Using Required field validator
<p>I have Dropdownlist whose value field and text field are bind at runtime.
it has --select-- as first item with a value of '0'
and the rest of the values are bind at runtime.</p>

<p>I have given validaton group for both the control and the validator as "g1"
and Intialvalue=0 </p>

<p>But still the page is posting  back even if I select '--select--' option.</p>

<pre><code>&lt;asp:DropDownList AutoPostBack="true" CssClass="dropdown" ValidationGroup="g1" ID="ddlReportType" runat="server" OnSelectedIndexChanged="ddlReportType_SelectedIndexChanged"&gt;&lt;/asp:DropDownList&gt;

&lt;asp:RequiredFieldValidator ControlToValidate="ddlReportType" ID="RequiredFieldValidator1"
ValidationGroup="g1" CssClass="errormesg" ErrorMessage="Please select a type"
InitialValue="0" runat="server"  Display="Dynamic"&gt;
&lt;/asp:RequiredFieldValidator&gt;
</code></pre>

<p>And code Behind to Bind the Dropdown </p>

<pre><code>ddlReportType.Items.Clear();
                    ddlReportType.DataSource = dt.Tables[0];
                    ddlReportType.DataTextField = "ReportType";
                    ddlReportType.DataValueField = "ReportTypeID";
                    ddlReportType.DataBind();
                    ddlReportType.Items.Insert(0, new ListItem("--Select--", "0"));
                    //ddlReportType.Items[0].Value = "0";
                    ddlReportType.SelectedIndex = 0;
</code></pre>
