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

  • 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. . . . . .

Comments are closed.