1
我在MVC 3上的預訂項目工作 我在這裏展示房間: 拿到房間的ID
當我點擊預留羅姆我來到這裏:
但我想要做的是獲得我直接在預訂表格房間框中選擇的房間號碼。
這裏是我創建視圖預約:
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>Reservation</legend>
<div class="editor-label">
@Html.LabelFor(model => model.Room_ID, "Room")
</div>
<div class="editor-field">
@Html.DropDownList("Room_ID", String.Empty)
@Html.ValidationMessageFor(model => model.Room_ID)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Guest_ID, "Client")
</div>
<div class="editor-field">
@Html.DropDownList("Guest_ID", String.Empty)
@Html.ValidationMessageFor(model => model.Guest_ID)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Data_Check_in)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Data_Check_in)
@Html.ValidationMessageFor(model => model.Data_Check_in)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Data_Check_out)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Data_Check_out)
@Html.ValidationMessageFor(model => model.Data_Check_out)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Preference_ID, "Preferinte")
</div>
<div class="editor-field">
@Html.DropDownList("Preference_ID", String.Empty)
@Html.ValidationMessageFor(model => model.Preference_ID)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Price)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Price)
@Html.ValidationMessageFor(model => model.Price)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Card_ID, "Card_de_credit")
</div>
<div class="editor-field">
@Html.DropDownList("Card_ID", String.Empty)
@Html.ValidationMessageFor(model => model.Card_ID)
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
我不知道如何做到這一點 – jonny 2012-04-25 23:46:50