我正在VS2013中使用MVC5开发一个站点,我有一个实体,例如:
type MyMailbox<'T>() =
let mbox = MailboxProcessor.Start( ... )
member val sP = ref(new SerialPort("0")) with get, set
member val receivedSeq : byte [] = Array.empty with get
在创建视图中,它显示Subcategory {
ID_Subcategory int,
ID_Category int,
ID_Product int,
Value string
}
的DropDowns。
现在,我使用以下内容从foreign keys
视图到达此页面/操作:
Product/Edit/5
在我的创建动作中我有这个
<a href="@Url.Action("Create", "Subcategory", new { ID_Product = Model.ProductID })">
它工作正常,现在我来自的产品设置在相应的DropDown中,但URL看起来像这样:
// GET: Subcategory/Create
public ActionResult Create(int? ID_Product )
{
ViewBag.ID_Category = new SelectList(db.Category, "ID_Category ", "Description");
ViewBag.ID_Product = new SelectList(db.Product, "ID_Product ", "Name");
Categories categories = new Categories();
categories.ProductID = (int)ID_Product ;
return View(categories);
}
我认为这可能存在安全隐患,请告诉我:
感谢