<%--for this working--%>
<%--for this not working--%>
onselectedindexchanged="ddlPayBy_SelectedIndexChanged" TabIndex="18" AutoPostBack="True">
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Khargesh RajputRank #616 · 3.9K reputationPosted Mar 25, 2015, 10:43 PM EDT
set initial value in second dropdown
Azaad Abbas127 reputationPosted Mar 25, 2015, 10:53 PM EDT
but if dropdown list dynamically bind then how to validate?
Azaad Abbas127 reputationPosted Mar 25, 2015, 11:00 PM EDT
Khargesh RajputRank #616 · 3.9K reputationPosted Mar 25, 2015, 11:01 PM EDT
if (objDs.Tables[0].Rows.Count > 0)
{
ddlClass.DataSource = objDs.Tables[0];
ddlClass.DataTextField = "class_name";
ddlClass.DataValueField = "id";
ddlClass.DataBind();
ddlClass.Items.Insert(0, new ListItem("----------- Select Class -----------", "0"));
}
and apply validation as above you add initial value="0" in requiredfield validater