【问题标题】:JQGrid not working with Query StringJQGrid 不使用查询字符串
【发布时间】:2015-06-11 11:12:23
【问题描述】:

我有一个工作正常的 JQGrid,直到我将 QueryString 添加到主 URL。 如果 URL 如下,则 JqGrid 正在工作: http://localhost:61605/Default.aspx

如果我改为:http://localhost:61605/Default.aspx/?Query1=SomeValue

然后它停止工作并给出错误

PopulationjQuery(...).jqGrid is not a function

TypeError: jQuery(...).jqGrid is not a function
    at LoadGrid (http://localhost:61605/Default.aspx/?Query1=SomeValue:289:34)
    at HTMLDocument.<anonymous> (http://localhost:61605/Default.aspx/?Query1=SomeValue:223:10)
    at x.Callbacks.l (http://ajax.microsoft.com/ajax/jquery/jquery-2.0.3.min.js:4:24882)
    at Object.x.Callbacks.c.fireWith [as resolveWith] (http://ajax.microsoft.com/ajax/jquery/jquery-2.0.3.min.js:4:25702)
    at Function.x.extend.ready (http://ajax.microsoft.com/ajax/jquery/jquery-2.0.3.min.js:4:2900)
    at HTMLDocument.S (http://ajax.microsoft.com/ajax/jquery/jquery-2.0.3.min.js:4:553)

有什么想法吗?

【问题讨论】:

    标签: jquery jqgrid-asp.net


    【解决方案1】:

    你注意到有一个/吗?

    http://localhost:61605/Default.aspx/?Query1=SomeValue
                                       ^
    

    如果您使用了相对路径,这将更改 jqGrid.js 的路径。确保您处理这种情况或使用绝对路径或相对于根的路径!

    我确信它会起作用,如果您将路径指定为:

    http://localhost:61605/Default.aspx?Query1=SomeValue
    

    网址:http://localhost:61605/Default.aspx?Query1=SomeValue

    【讨论】:

    • 完美。我好像变老了:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-08
    相关资源
    最近更新 更多