मैं MVC 3 में एक होटल रिजर्वेशन प्रोजेक्ट पर काम कर रहा हूं यहाँ मैं कमरे प्रदर्शित करता हूँ:
जब मैं एक रोम आरक्षित करने के लिए क्लिक करता हूँ तो मुझे यहाँ मिलता है:
लेकिन जो मैं करना चाहता हूं वह यह है कि रिजर्वेशन फॉर्म रूम बॉक्स में सीधे चुने गए कमरे की संख्या प्राप्त करें।
यहां आरक्षण के लिए मेरा बनाएं दृश्य है:
@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>
}
उत्तर:
जवाब के लिए 2 № 1क्या आप व्यू मॉडल का उपयोग करके रूम आईडी को पहले पेज से फॉर्म पेज तक पहुंचा सकते हैं?