Non è possibile Navigate()
e utilizzare ancora POST. Navigate
equivale a fare clic su un collegamento o a digitare un URL nella barra degli indirizzi, che richiama il verbo GET.
Per utilizzare POST, si potrebbe invece utilizzare il browser Silverlight interoperabilità per creare a livello di codice un HTML <form>
, impostare il suo attributo action
per l'URL corretto, impostare il suo attributo target
-"_blank"
, aggiungere un po '<input type="hidden">
campi, impostare i loro nomi e valori e quindi submit()
il modulo.
// Get document and body
var doc = System.Windows.Browser.HtmlPage.Document;
var body = doc.Body;
// Create a <form> 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");
fonte
2012-02-07 12:06:21
grazie, è stato utile – Masoomian