从silverlight导航和发布数据

我的项目是silverlight navighation项目(IN-Browser)我想导航到一个Url,例如:

System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(string.Format("http://{0}: {1}/ReportProject.aspx#/Supplies/RequestGoods/RequestGoodsDashboard", Application.Current.Host.Source.Host, Application.Current.Host.Source.Port)), "_blank", ""); 

并使用post方法向目标页面发送许多参数

我怎么能这样做?

你不能Navigate()并仍然使用POST。 Navigate相当于单击链接或在地址栏中键入URL,该地址栏调用GET动词。

要使用POST,您可以使用Silverlight浏览器互操作以编程方式创建HTML

,将其action属性设置为正确的URL,将其target属性设置为"_blank" ,添加一些字段,设置他们的名字和值,然后submit()表格。

 // Get document and body var doc = System.Windows.Browser.HtmlPage.Document; var body = doc.Body; // Create a 
element and add it to the body var newForm = doc.CreateElement("form"); newForm.SetAttribute("action", targetUrl); newForm.SetAttribute("method", "post"); body.AppendChild(newForm); // TODO: doc.CreateElement("input"); // TODO: SetAttribute("type", "hidden"); // TODO: SetAttribute("name", someName); // TODO: SetAttribute("value", someValue); // TODO: newForm.AppendChild() newForm.Invoke("submit");