html.actionLink - 如何传递object和set area ="" [英] html.actionLink - how to pass object and set area=""

查看:93
本文介绍了html.actionLink - 如何传递object和set area =""的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿朋友,



我正在尝试添加指向不同区域的页面的链接,并传递一个对象。我想去的地方是(根)。我当前的actionLink结构创建了正确的URL,但基数错误(需要删除当前领先区域)



带链接的URL:

http://soemthing.com/manager/tickets/details/1234

链接需要点这里:

HTTP?: //something.com/TransactionMonitor/TicketsByDay?Defaul ...



以下是代码:

Hey Friends,

I'm trying to add a link to a page that is in a different area, and pass along an object. The area I'm trying to go to is "" (root). My current actionLink structure creates the correct URL with the exception that the base is wrong (need to remove the leading current area)

URL with link:
http://soemthing.com/manager/tickets/details/1234
Link needs to point here:
http://something.com/TransactionMonitor/TicketsByDay?Defaul...

Here is the code:

@Html.ActionLink("Details", "TicketsByDay", "TransactionMonitor", new GetTicketsByDayRequest { StoreId = @Model.Id, EndDate = @Model.EndDate, StartDate = @Model.StartDate }, null) 





TransactionMonitor控制器是在根目录中,但带有链接的页面位于经理区域



TransactionMonitor controller is in the root, but the page with the link is in an area 'Manager'

推荐答案

这总是发生....我花了3个小时破坏了我的大脑和我一求得求助就找到了答案...



this always happens....i spend 3 hours wrecking my brain and as soon as i ask for help I find the answer...

@Html.ActionLink("Details", "TicketsByDay", "TransactionMonitor", new  {area = "", StoreId = @Model.Id, EndDate = @Model.EndDate, StartDate = @Model.StartDate }, null) 


这篇关于html.actionLink - 如何传递object和set area =""的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆