asp.net webforms durandaljs 2.0请求查询字符串

asp.net webforms durandaljs 2.0请求查询字符串,asp.net,knockout.js,routing,webforms,durandal,Asp.net,Knockout.js,Routing,Webforms,Durandal,我目前正在使用asp.net 3.5 web表单,但从查询字符串获取值时遇到问题。我该怎么做呢 我有一个webforms页面,带有指向自身的链接[这些初始化durandal] <li>Go to <a href="#/123">Details</a></li> <li>Go to <a href="#Location/123">Location</a></li

我目前正在使用asp.net 3.5 web表单,但从查询字符串获取值时遇到问题。我该怎么做呢

我有一个webforms页面,带有指向自身的链接[这些初始化durandal]

            <li>Go to <a href="#/123">Details</a></li>
            <li>Go to <a href="#Location/123">Location</a></li>
我还尝试将activate:function()设置为activate:function(ref),但这似乎根本无法拦截参数

任何帮助都将不胜感激? 我知道在将durandaljs与webforms混合使用时应该不会有问题,但是有什么我应该注意的吗


谢谢。

路由器将查询字符串作为序列化对象传递到激活函数中。您还可以从
router.activeInstruction()
获取查询字符串,谢谢Tyrsius。你有我可以看的代码示例吗?或者给我指一个?不,但是你可以从网上得到同样的信息。传递给
activate
函数的最后一个参数(在所有路由参数之后)是查询字符串的散列。谢谢Tyrsius。解释了为什么我在整理它时遇到困难,因为所有的示例都基于v1.2。Durandal v2以不同的方式处理转换文档。谢谢你的帮助。
return {
    router: router,
    items: items,
    activate: function () {
        router.map([
            { route: ['#/:ref', 'Property/:ref'], moduleId: 'viewmodels/property', title: 'Property Details', nav: true },
            { route: 'Location/:ref', moduleId: 'viewmodels/location', title: 'Location Details', nav: true }
        ]).buildNavigationModel();

        return router.activate();
    }