2011-01-28 99 views
0

我使用的是Asp.net-mvc 2.0,而我打算给ajax.actionlink弹出窗口来调用一个新的页面actionresult,我无法调用弹出窗口,它抛出了一个错误。Ajax.ActionLink弹出窗口不起作用

我的示例代码: - (?)。

<%= Ajax.ActionLink("GetFuncao", "GetFuncao?height=155&width=300&inlineId=hiddenModalContent&modal=true", "Funcao", new { ID = Model.ID_Sistema }, 
    new AjaxOptions { }, new { @class = "thickbox", id = "thickbox", title="Cadastro de Sistemas" })%> 

虽然我使用此代码,下面的错误发生,

“从客户端检测到有潜在危险的Request的值

你能帮我解决这个问题吗?谢谢你的时间。

回答

0

你应该通过查询字符串参数在routeValues不与动作的名称,如:

<%= Ajax.ActionLink(
    "GetFuncao", 
    "GetFuncao", 
    "Funcao", 
    new { 
     ID = Model.ID_Sistema, 
     height = "155", 
     width = "300", 
     inlineId = "hiddenModalContent", 
     modal = "true" 
    }, 
    new AjaxOptions { }, 
    new { @class = "thickbox", id = "thickbox", title="Cadastro de Sistemas" } 
)%> 
0

移动路线值到正确的位置,即

<%= Ajax.ActionLink("GetFuncao", "GetFuncao", "Funcao", new { ID = Model.ID_Sistema, height=155, width=300, inlineId="hiddenModelContent", modal = true }, 
    new AjaxOptions { }, new { @class = "thickbox", id = "thickbox", title="Cadastro de Sistemas" })%> 
相关问题