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 :
if you follow all the steps and also COPY-PASTE the whole code given below:
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 🙂
Hope this helps 🙂