<div class="FormContainer"> <table> <tr> <td class="Label"> @Html.Label("*Name of District") </td> <td align="center"> <select class="ddl" id="Districtddl"> <option id="0">----Select District----</option> @foreach (System.Data.DataRow dr in FarmerRegisterFormAndPrint.Models.StoredProcedures.GetAllDistrict().Rows) { <option @dr["DistrictId"].ToString()>@dr["DistrictName"].ToString()</option> } </select> <br /> @Html.ValidationMessageFor(x => x.District) </td> </tr> @{var DistrictID = Request.Form["Districtddl"];} <tr> <td class="Label"> @Html.Label("*Name of Tehsil") </td> <td> <div class="ddl2" id="tehsil" align="center"> @*@Html.Partial("_Tehsil")*@ <select class="ddl" id="Tehsilddl"> <option id="0">----Select District----</option> I want to store the value of First DDL and pass it to DistrictDDL @if(Request.Form["Districtddl"]!=null) { foreach (System.Data.DataRow dr in FarmerRegisterFormAndPrint.Models.StoredProcedures.GettehsilAccToDistrict(DistrictID).Rows) { <option @dr["TehsilId"].ToString()>@dr["TehsilName"].ToString()</option> } } </select> </div> </td> </tr> @{var TehsilId = Request.Form["Tehsilddl"];} <tr> <td class="Label"> @Html.Label("*Name of Sub Tehsil") </td> <td> <div id="Subtehsil" align="center">@*@Html.Partial("_SubTehsil", Model)*@ <select class="ddl" id="Districtddl"> <option id="0">----Select District----</option> @if(Request.Form["Tehsilddl"]!=null) { foreach (System.Data.DataRow dr in FarmerRegisterFormAndPrint.Models.StoredProcedures.GetsubtehsilAccToTehsil(TehsilId).Rows) { <option @dr["SubTehsilId"].ToString()>@dr["SubTehsilName"].ToString()</option> } } </select> </div> </td> </tr> <tr>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)