I need to post data to other website using C#.
<form action="http://localhost:2180/PrepDoc.aspx" method="post" target="my_frame" > <input type="text" name="someText" value="Some Text" /> <input type="submit" runat="server" /> </form> <iframe id="myIframe" name="my_frame" runat="server" > this is working fine but i need to do this using c#.
can some one guide me before i was trying to post data using onclick button code but it takes to the prepdoc page that i dont want .
HttpResponse httpResponse = HttpContext.Current.Response; httpResponse.Clear(); httpResponse.Write("<html><head></head>"); httpResponse.Write(string.Format( "<body onload=\"document.{0}.submit()\">", "frmCart")); httpResponse.Write(string.Format( "<form name=\"{0}\" method=\"{1}\" action=\"{2}\" target=\"my_frame\">", "frmCart", "Post", "http://localhost:2180/PrepDoc.aspx")); httpResponse.Write("</form>"); httpResponse.Write("</body></html>"); httpResponse.End(); I want this to be on Default page (caller page) and in iFrame. Any help will be appreciated.