# AJAX xmlhttprequest + viewstate

**URL:** <https://forum.kirupa.com/t/ajax-xmlhttprequest-viewstate/276587>\
**Category:** web dev\
**Created:** [December 1, 2008, 10:58am UTC](https://forum.kirupa.com/t/ajax-xmlhttprequest-viewstate/276587 "2008-12-01T10:58:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamu](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@adamu](https://forum.kirupa.com/u/adamu)\
**Post date:** [December 1, 2008, 10:58am UTC](https://forum.kirupa.com/t/ajax-xmlhttprequest-viewstate/276587/1 "2008-12-01T10:58:04Z")

</div>

Hello everyone!

I have a problem I have run into recently writing a widget.

Basically, it is just to monitor internet usage, so it gets the upload and download values from a members webpage.

I can request the login page and get what I need from it, which includes fields like username and password, but there is a hidden viewstate field.

I can get the viewstate value easily enough with a regex, but when I post all the values back to the same page I get a runtime error.

I was wondering if anyone has had experience with logging into aspx pages that postback to themselves and have a viewstate hidden field.

I can’t see the exact error cause, because it isn’t a webpage I control and they have remote error messages turned off.

Thanks for any help you can give!
