ASP.net Receive Post

I need to build a page to receive XML data via a POST method and return a status code. I've managed to get my code working as part of a normal aspx page, but seem to be having issues with returning the status. When I read the response from my test page (submitted via php) I am getting the html content of the page, not the status code. How do I need to build my receiving page to make this work properly?
tsprksAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MlandaTCommented:
Are you setting the status in your ASP.NET page?
Response.StatusCode = HttpStatusCode.OK
Response.End

Open in new window


Enumeration documentation here: HttpStatusCode
tsprksAuthor Commented:
Ok, that gets me much closer. Now I'm receiving my StatusCode back, but it appears that my try/catch isn't working like I'm used to in windows applications. What is the proper way to handle errors in my vb.net codebehind? How do I stop the procedure from executing and return the value?
MlandaTCommented:
Yuor try/catch will work exactly the same as it always has regardless of whether we are in ASP.NET or WinForms or etc. However, Response.End does throw an exception (ThreadAbortException)... just catch that specific one and ignore it (or google for ways to avoid ThreadAbortException from Response.End)

*How do I stop the procedure from executing and return the value?* Without knowing much about your code, I can only suggest to do a "return" "exit sub" or "exit function"... not sure...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tsprksAuthor Commented:
Thanks for you help with this. I didn't realize that Response.End was actually throwing and error, as soon as I accounted for that, it's working perfectly.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.