The trouble is, a form is more than the visible fields - you need to make
sure you post back any hidden fields as well, because these are generally
used for maintaining state.  There may also be JavaScript postback functions
that pre-process a form before it's submitted (certainly the case in ASP.Net
for client-side validation).  In other words, it's a pretty big task to make
this work for many different types of form, because just POSTing the field
values is usually only half the story.

Jim

> -----Original Message-----
> From: Marc Mertens [mailto:[EMAIL PROTECTED]]
> Sent: 16 May 2002 13:14
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] Using HttpWebRequest to fill in a webform
>
>
> Because I want to write a client which can interact not only with
> a IIS server with dotnet but with som general webforms (using PHP,
> CGI, ASP , JSP ..) and I'm assuming that I have no control over the
> server side. By the way I thought viewstate is specific for ASP.NET
> so how do you proceed if the other side is not using ASP.NET
>
> Thanks a lot in advance
>
> Marc
>
> -----Original Message-----
> From: Jim Arnold [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 2:00 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] Using HttpWebRequest to fill in a webform
>
>
> You'd need to post the viewstate back as well, but why bother
> with any of
> that?  Couldn't you write a web service or other
> remote-callable interface
> of faking a browser?
>
> Jim
>
> > -----Original Message-----
> > From: Marc Mertens [mailto:[EMAIL PROTECTED]]
> > Sent: 16 May 2002 12:55
> > To: [EMAIL PROTECTED]
> > Subject: [DOTNET] Using HttpWebRequest to fill in a webform
> >
> >
> > Hallo,
> >
> >      I'm trying to write a application that automaticall
> fills in the
> > input fields of a webform and let the webform process this request.
> > More concreat suppose that you have a webform with two input
> > fields and
> > a submit button. If you fill in the fields and press the
> submit button
> > some processing is done at the webserver, I want to make a
> application
> > that replace the browser and automate the filling in of the
> > form. I use
> > HttpWebRequest to send a POST request to the webform and get
> > the response
> > back. The webform seems to receive the request with the correct date
> > (verified with the Page.Request property on the Page_Load
> > delegate, but it
> > will not issue a click event for the button, so no processing
> > is done at
> > the webserver, how can I ensure that my client application
> > force the 'click'
> > on the submit button.
>
> You can read messages from the DOTNET archive, unsubscribe
> from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
> You can read messages from the DOTNET archive, unsubscribe
> from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to