Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a Form which contains cascading dropdown lists now i want to call a controller on the selection of first DDL passing the selection id to it.
I also have a Submit button which will be used to post the form but when i select an item from DDL the form is posted

Quote:
@using (Html.BeginForm("Details", "Home", FormMethod.Post))
{
@Html.Partial("_District")
@Html.Partial("_Tehsil")
@Html.Partial("_SubTehsil")
}


<input type="submit" value="Check" />


I want to post the form on the button submit but somehow it is getting posted when i select an item from District DDL

Now in _District.cshtml view i have which is almost same for _tehsil and _subtehsil Views ...

Quote:
<select name="district" id="Districtddl" class="ddl">
option value="0">---Select District---</option>
@foreach (System.Data.DataRow dr in FarmerRegisterFormAndPrint.Models.StoredProcedures.GetAllDistrict().Rows)
{
<option value='@dr["DistrictId"].ToString()'>@dr["DistrictName"].ToString()</option>
}
</select>



Also any idea how to implement Cascading dropdown list on registeration form using mvc ajax
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900