public ActionResult Orders1(int order)
{
CostcoEntities1 context = new CostcoEntities1();
var query = from a in context.CM_Checkout_Details
where a.CheckoutDetails_ID == order
select a;
return View(query);
}
Hello everyone!! I am new and need some help. I want to create 10 textbox to display the reference item details. The first textbox works fine however the second textbox states that the order parameter is null. I know this is a simple task and I am very new to MVC. Please help!!!I prefer to do this with html helper (if possible)
thank you in advance!!!
VIEW
@using (Html.BeginForm("Orders1", "Track", FormMethod.Post))
{
for (int i = 1; i < 11; i++)
{
@i <input type="text" name="order" /><br />
}
<input type="submit" value="Submit" />
}
I believe this is going to be what you are looking for. You can extend the htmlAttributes as needed.
@model IEnumerable<TypeGoesHere>
@foreach(var item in (IEnumerable<TypeGoesHere>)Model)
{
@Html.TextBoxFor(x=>item.SomeProperty, null,new {@name="order"})
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.