Skip to content
September 2, 2009 / kiranpatils

Programmatically Posting Data to ASP .NET Web Applications

Usually what we do. We open a page and fill up a form and submit a form data by pressing “Submit” Button. And after that we get some data/response  as per the logic.  But how to do this programmatically?? — That’s what we have been doing since so long..we faced too many challenges and finally we made it working. You also want to do the same then here we go…

First follow this nice article :

http://dotnet.sys-con.com/node/45127

if you follow all the steps and also COPY-PASTE the whole code given below:

http://gemsres.com/photos/story/res/45127/source.html

IT WON’T WORK

As someone has already commented on that post — That it throws Internal Server Error(500). But unfortunately no solution has been answered. But don’t worry. i’m here to answer that🙂

Okay, The problem is in your target ASPX page — Means ASPX Page which has form tag. it should have event validation false:

<%@ Page EnableEventValidation=”false” %>

That’s it. It should work now. And if it dosen’t works then try to debug using Fiddler — Really great tool

Okay, So in short to post form data programmatic ally using ASP.NET following steps are required.

1. ViewState Must be passed.

2. In Target page — enableeventvalidation – false.

3. Fiddler must need to install to see what’s going on🙂

Webliography

http://xneuron.wordpress.com/2007/12/05/programmatically-post-a-form-in-aspnet/

http://schleichermann.wordpress.com/2009/07/13/asp-net-programmatically-submit-form-post/

Hope this helps🙂

2 Comments

Leave a Comment
  1. mikekdm / May 23 2010 9:32 pm

    hey, I’m new here can someone tell me how can save videos from youtube?

  2. Mabyaffenty / Sep 20 2011 11:48 pm

    Man .. Excellent .. Wonderful .. I’ll bookmark your blog and take the feeds alsoI am satisfied to search out numerous useful info here within the put up, we need develop more techniques on this regard, thank you for sharing. . . . . .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: