Posts

Showing posts with the label drop-down-menu

Asp .net MVC Dropdownlist validation not working

Asp .net MVC Dropdownlist validation not working Here is my Code, Am in learning stage please some one help me. Have three issue 1)validation not working. 2)In controller side modelState is invalid. 3) How to reset dropdownlist after submit. public List<mstrClient> getCountry() { mstrClient objClientList = new mstrClient(); DataSet ds = new DataSet(); string sQuery = "SELECT * FROM INV_mstrCountry WHERE CStatus = 'Y'"; SqlDataAdapter da = new SqlDataAdapter(sQuery, con); con.Open(); da.Fill(ds); con.Close(); List<mstrClient> CountryList = new List<mstrClient>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { mstrClient objClient = new mstrClient(); objClient.CountryCode = ds.Tables[0].Rows[i]["CountryCode"].ToString(); objClient.Country = ds.Tables[0].Rows[i]["CountryName"].ToString(); Count...