简体   繁体   English

从Silverlight重定向到另一个页面

[英]redirect to another page from Silverlight

In side a Silverlight Page, I want to redirect to another aspx page in the same web site and using POST method to send some additional header information. 在Silverlight页面中,我想重定向到同一网站中的另一个aspx页面,并使用POST方法发送一些额外的头信息。 Any ideas how to implement this? 任何想法如何实现这一点? Any samples are appreciated. 任何样品都表示赞赏。 :-) :-)

I am using VSTS2008 + .Net 3.5 + Silverlight 2.0 + C#. 我使用的是VSTS2008 + .Net 3.5 + Silverlight 2.0 + C#。

My suggestion would be to have a Visibility=hidden Button on the page, and then use javascript to retrieve it and .Click() it. 我的建议是在页面上有一个Visibility = hidden按钮,然后使用javascript来检索它和.Click()它。 Thus you get to do a post without all the work that this guy went through: http://mentaljetsam.wordpress.com/2008/06/02/using-javascript-to-post-data-between-pages/ 因此,你可以在没有这个人经历的所有工作的情况下做一个帖子: http//mentaljetsam.wordpress.com/2008/06/02/using-javascript-to-post-data-between-pages/

Especially considering it's a bear to craft a POST-to-ASP.NET through javascript, as ASP.NET requires pesky things like viewstate etc. 特别是考虑到通过javascript制作POST-to-ASP.NET是一种熊,因为ASP.NET需要像viewstate等讨厌的东西。

I think you're looking for HtmlPage.Document.Submit() . 我想你正在寻找HtmlPage.Document.Submit()。

Can Silverlight initiate Page Refreshes? Silverlight可以启动页面刷新吗?

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

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