Client Side Web Request and auto-submitting ASP.Net pages

  • Thread starter Rick Strahl [MVP]
  • Start date
R

Rick Strahl [MVP]

Run into an interesting problem today with a client of mine:

They have an ASP.Net form that they want to drive through a client side HTTP
interface. I know a Web Service would be a better way to go but in this case
they want to try and consolidate a single interface for the 3 or 4 forms
involved and drive them through a WebRequest Http client.

The data is getting there no problem - it's retrievable with
Request.Form["formfield"]. However ASP.net is not doing anything to fire
events or even assign the data back to the original form fields.

Anybody know of a way to trigger ASP.Net to force it to read and assign the
form variables and fire events?

I think the problem is likely to be viewstate (even though it's disabled
there's still viewstate being placed on the form), but even when I post back
the viewstate from the 'base' page it doesn't work.

This seems like a fairly major issue if there is no workaround since you
basically cannot drive HTML remotely through ASP.Net forms...

Any ideas how to make this work?

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
 
B

bruce barker

there is no problem driving an asp.net site thru a http client. you are
correct, you need to pass back the valid viewstate that came with the page.
to fire events you need to emulate browser behavior.

when the client requests (gets) the form how are you parsing the html to get
the viewstate.
when the client posts the form back, it needs to send the submit button
value, for the button to firte an event.
when the client post back from a non-submit control, it has to fill in the
postback hidden fields.

also what user agent is the client using, and how is it supporting cookies?

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top