我的观点如下。我有两个提交按钮;一为find new car
一为find used car
。如何获取控制器中选定下拉列表的值?
以及如何找出用户按下了 2 个按钮中的哪一个?
@{
ViewBag.Title = "Home Page";
}
@using (Html.BeginForm("Home", "home"))
{
<table>
<tr>
<td>
<h2>
Find New car</h2>
<table>
<tr>
<td>
<select id="ddlBrand" name="ddlbrand" style="width: 200px;">
<option value="0">---Select Brand---</option>
<option value="1">---b1---</option>
</select>
</td>
</tr>
<tr>
<td>
<select id="ddlModel" name="ddlModel" style="width: 200px;">
<option value="0">---Select Model---</option>
</select>
</td>
</tr>
<tr>
<td>
<select id="ddlFuelType" name="ddlFuelType" style="width: 200px;">
<option value="0">---Select Fuel Type---</option>
</select>
</td>
</tr>
<tr>
<td>
<select id="ddlBudget" name="ddlBudget" style="width: 200px;">
<option value="0">---Select Your Budget---</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="button" name="FindNewCar" value="GO" />
</td>
</tr>
</table>
</td>
<td>
<h2>
Find used car</h2>
<table>
<tr>
<td>
<table>
<tr>
<td>
<select id="ddlBrand1" name="ddlbrand" style="width: 200px;">
<option value="0">---Select Brand---</option>
</select>
</td>
</tr>
<tr>
<td>
<select id="ddlModel2" name="ddlModel" style="width: 200px;">
<option value="0">---Select Model---</option>
</select>
</td>
</tr>
<tr>
<td>
<select id="ddlFuelType2" name="ddlFuelType" style="width: 200px;">
<option value="0">---Select Fuel Type---</option>
</select>
</td>
</tr>
<tr>
<td>
<select id="ddlCity" name="ddlCity" style="width: 200px;">
<option value="0">---Select City---</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="button" name="FindNewCar" value="GO" />
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<h4>
Sell Car</h4>
<br />
Sell your car faster, at right price ...<a href="#"> Sell Car»</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td>
aaaaaaaaaaa
</td>
</tr>
</table>
}