Link to home
Start Free TrialLog in
Avatar of tsprks
tsprksFlag for United States of America

asked on

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?
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

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

Open in new window


Enumeration documentation here: HttpStatusCode
Avatar of tsprks

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tsprks

ASKER

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.