redirect to another page from Silverlight

。_饼干妹妹 提交于 2019-12-19 09:27:35

问题


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. Any ideas how to implement this? Any samples are appreciated. :-)

I am using VSTS2008 + .Net 3.5 + Silverlight 2.0 + C#.


回答1:


My suggestion would be to have a Visibility=hidden Button on the page, and then use javascript to retrieve it and .Click() it. 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/

Especially considering it's a bear to craft a POST-to-ASP.NET through javascript, as ASP.NET requires pesky things like viewstate etc.




回答2:


I think you're looking for HtmlPage.Document.Submit() .

Can Silverlight initiate Page Refreshes?



来源:https://stackoverflow.com/questions/1318703/redirect-to-another-page-from-silverlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!