如何传递参数给本地的HTML页面WP7 / WP8? [英] How to pass a parameter to a local html page in WP7 / WP8?

查看:140
本文介绍了如何传递参数给本地的HTML页面WP7 / WP8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何将一个URL参数在Web浏览器控件传递给本地页面?

Does anyone know how to pass a url parameter to a local page in the Web Browser Control?

当您浏览的页面单独 一切都很好,但只要您添加参数 我得到一个错误页面,说明我们无法导航到该页面。结果
中所述的想法?

When you navigate to the page alone "/Html/MyPage.html" all is well but as soon as you add a parameter "/Html/MyPage.html?Message=Hello" I get an error page stating that we could not navigate to the page.
Any ideas?

推荐答案

另一个解决办法,你可以通过你的参数作为位置哈希参数(如果不使用它)

As another workaround you can pass your arguments as location hash parameter (if it is not used)

browser.Navigate(new Uri("www/index.html#p=123&p2=567", UriKind.Relative));



,然后在index.html的

and then in index.html

var args = window.location.hash;



(参数='#P = 123安培; P2 = 567')

(args = '#p=123&p2=567')

在测试了WP7(index.html的存储在独立存储)+ WP8(index.html的是直接从XAP加载)

Tested on WP7 (index.html is stored in isolated storage) + WP8 (index.html is loaded directly from XAP)

这篇关于如何传递参数给本地的HTML页面WP7 / WP8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆