Questions tagged «url.action»

4
网址操作参数?
在列表控制器中, public ActionResult GetByList(string name, string contact) { var NameCollection = Service.GetByName(name); var ContactCollection = Service.GetByContact(contact); return View(new ListViewModel(NameCollection ,ContactCollection)); } 在ASPX页面中,我称之为 <a href="<%:Url.Action("GetByList","Listing" , new {name= "John"} , new {contact="calgary, vancouver"})%>"><span>People</span></a> 我在ASPX代码中有问题...我可以拉出名字john的记录。但是当我给时contact="calgary, vancouver",网页就会出错。 如何在中调用两个参数Url.Action。我尝试了以下内容,但这似乎也是错误的。 <a href="<%:Url.Action("GetByList","Listing" , new {name= "John" , contact= " calgary, vancouver" })%>"><span>People</span></a>

2
Url.Action放置& 在我的网址中,我该如何解决?
我想将变量itemId和EntityModel发送到ActionResult CreateNote: public ActionResult CreateNote( [ModelBinder(typeof(Models.JsonModelBinder))] NoteModel Model, string cmd, long? itemId, string modelEntity) 与此JavaScript: Model.meta.PostAction = Url.Action("CreateNote", new { cmd = "Save", itemId = itemId, modelEntity = modelEntity}); 但是,正在发送的网址是 localhost:1304/Administration/blue/en-gb/Entity/CreateNote?modelEntity=Phrase&itemId=44 我想发送 localhost:1304/Administration/blue/en-gb/Entity/CreateNote?modelEntity=Phrase&itemId=44 如何防止Url.Action将&放在要发送的第二个变量前面?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.