Re: Missing __VIEWSTATE



"Marius Horak" <nobody@xxxxxx> wrote in message
news:eX6QqEEaGHA.4548@xxxxxxxxxxxxxxxxxxxx
When using axWebBrowser my logic is as follows (and it works every
time)

Step 1.

string url = "http://www.ServerName.com/API.dll/Get=103";;
axWeb.Navigate(url, ref flags, ref targetFrameName, ref postData, ref
headers);

Step 2.

On NavigateComplete2 I get the input elements, set their value, get
the form element and call submit(). And I'm getting my pdf file within
axWeb.

Now how to reproduce these two steps with HttpWebRequest?

You download a page at http://www.ServerName.com/API.dll/Get=103 . You
parse the HTML looking for the <form> tag and for <input> tags inside.
You build your POST data, taking into account all the <input
type="hidden"> fields (in addition to the user name and password, of
course). You also need to extract the action= attribute from the <form>
element - this is where you send your POST request.

If this page does not change from navigation to navigation, you can skip
this step and essentially hardcode the POST data.

Second, you use HttpWebRequest to send a POST request to the URL you
extracted from action= attribute on step 1.

The first HttpWebRequest should be to
http://www.ServerName.com/API.dll/Get=103 and next somehow the same
request should accept a new address. But the Address property is read
only.

You don't need to use the same HttpWebRequest object. In fact, it
appears that you can't, that the URL of the request is fixed at the time
the object is created. You simply create a new instance of
HttpWebRequest for every request you need to send.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: Suggestion please
    ... I have try to configure the event as you mention but the record seem dont ... Request Form is already automatically filled in time and date by define the ... The MIS Form will retrieve the record by Ref No ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Suggestion please
    ... I have try to configure the event as you mention but the record seem dont ... Request Form is already automatically filled in time and date by define the ... The MIS Form will retrieve the record by Ref No ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Tightest integration of C++ and C#
    ... if you use winapi standard entry points, you can just use C# declarations to call the libraries. ... the last is to use com. this requires discipline in C# to release ref counters when done. ... a class instance is created and destroyed for each request. ... I have loads of C++ libraries - what is the technology/methodolgy that provides the tightest integration of C++ and the .Net languages ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Missing __VIEWSTATE
    ... not go into a header - it's the target of the request. ... axWeb.Navigate(url, ref flags, ref targetFrameName, ref postData, ref ... Now how to reproduce these two steps with HttpWebRequest? ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: How to set value of <INPUT type=file...> element programmatically?
    ... I need to simulate send POST data (- file upload) as it was submitted in ... ie.Navigate(url, ref o, ref o, ref o, ref o); // navigate to page with the ...
    (microsoft.public.dotnet.languages.csharp)