【问题标题】:Ajax.ActionLink Pop-Up not workingAjax.ActionLink 弹出窗口不起作用
【发布时间】:2011-01-28 12:56:51
【问题描述】:

我正在使用 Asp.net-mvc 2.0,而我要让 ajax.actionlink pop 来调用一个新页面 actionresult 我无法调用 pop-up,它抛出了一个错误。

我的示例代码:-

<%= 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.Path 值 (?)。

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

【问题讨论】:

    标签: asp.net-mvc


    【解决方案1】:

    您应该在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" }
    )%>
    

    【讨论】:

      【解决方案2】:

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

      <%= 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" })%>
      

      【讨论】:

        猜你喜欢
        • 2012-08-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-12-17
        • 2019-01-14
        • 2014-12-21
        • 2016-10-03
        • 1970-01-01
        相关资源
        最近更新 更多