我有一个很奇怪的问题,我写道:
if (company == null || company.getGroup() == null
|| company.getGroup().getPerson() == null
|| company.getGroup().getPerson().length() == 0 )
{
return false;
}
return true;
但我明白了:
@Ajax.RawActionLink(
"<i class=\"fa fa-print\"></i>",
"CustomerOrder",
"PrintSheet",
new AjaxOptions()
{
UpdateTargetId = "bodyContent",
InsertionMode = InsertionMode.Replace,
HttpMethod = "GET"
},
new
{
@class = "btn btn-success",
data_toggle = "tooltip",
data_placement = "top",
title = "Imprimer"
})
在渲染的Html中。
我正在从另一个控制器调用print <a class="btn btn-success"
data-ajax="true"
data-ajax-method="GET"
data-ajax-mode="replace"
data-ajax-update="#bodyContent"
data-placement="top"
data-toggle="tooltip"
href="/Sales/CustomerOrder?Length=10"
title=""
data-original-title="Imprimer">
<i class="fa fa-print"></i>
</a>
动作,但我总是得到路径中的当前控制器,不知道吗?
Ps:我正在使用Ajax ActionLink的扩展
CustomerOrder
答案 0 :(得分:1)
假设RawActionLink包含在ActionLink中,似乎您的目标是错误的重载方法。尝试:
@Ajax.RawActionLink(
"<i class=\"fa fa-print\"></i>", //content
"CustomerOrder", //action
"PrintSheet", //controller
new {}, //routing data <---- ADDED
new AjaxOptions() //ajax options
{
UpdateTargetId = "bodyContent",
InsertionMode = InsertionMode.Replace,
HttpMethod = "GET"
},
new //html attributes
{
@class = "btn btn-success",
data_toggle = "tooltip",
data_placement = "top",
title = "Imprimer"
})