简体   繁体   English

用自定义的URL参数启动VS2010 silverlight调试session

[英]Start VS2010 silverlight debugging session with custom URL parameters

When I debug a Silverlight app, Visual Studio will just open the page with no extra URL parameters.当我调试 Silverlight 应用程序时,Visual Studio 将只打开没有额外 URL 参数的页面。

So, the url will look something like this: http://localhost:65351/MyApp/因此,url 将如下所示: http://localhost:65351/MyApp/

However, I want to add some specific functionality when someone navigates to the pages with extra parameters in the URL.但是,当有人导航到 URL 中带有额外参数的页面时,我想添加一些特定功能。 For instance: http://localhost:65351/MyApp/A2Sk9zu例如: http://localhost:65351/MyApp/A2Sk9zu

That being a shortened link, which my app will interpret.这是一个缩短的链接,我的应用程序将对其进行解释。

I get that I can access the URL paremeters via HtmlPage.Document.QueryString.Keys but I can't seem to start a debugging session with any parameters to actually check if the flow is handled correctly.我知道我可以通过HtmlPage.Document.QueryString.Keys访问 URL 参数,但我似乎无法使用任何参数开始调试 session 以实际检查流程是否处理正确。

On your.web project, hosting the Silverlight app, right click and select "Properties".在您的.web 项目上,托管 Silverlight 应用程序,右键单击并 select“属性”。

Under "Web" there is a "Start action" section.在“Web”下有一个“开始操作”部分。 Under "Start action" it will probably be set to "Specific page" and shows your start hosting page.在“开始操作”下,它可能会设置为“特定页面”并显示您的开始托管页面。 eg Default.aspx例如 Default.aspx

Just change the URL there to add your parameters eg Default.aspx?test=123只需更改 URL 以添加您的参数,例如 Default.aspx?test=123

(Of course the alternative is to just change the URL of your browser by hand, once the app has started). (当然,另一种方法是在应用程序启动后手动更改浏览器的 URL)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM