__VIEWSTATE - how to know its value ?

Hi,
I need to manage a web-site in Windows program.
The site is written in ASP.NET.
I have problem in making POST.
In the code attached there are POST queries of IE and "My program".
In my program I set values of "ComboBoxes" (there are three of them), get value of VIEWSTATE before POST with GET and all the value send with query.
IE works fine, but my program is redirected to "Error Page".
Could you please look at queries and help me to find out what I am doing wrong.
If reqiured, I can show a full source code of IE Page.

P.S. I have no access to code of Server-side.
P.S2. I have only 195 points available %(
////////////// Internet Explorer   ////////////////////////////////
POST /Reestrs/Reestr/default.aspx?part=Reestrs&1=action|Create@id|-1@contractid|-1@actionback|None HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: https://dealer.beeline.kz/Reestrs/Reestr/default.aspx?part=Reestrs&1=action|Create@id|-1@contractid|-1@actionback|None
Accept-Language: ru
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.2; .NET CLR 3.5.21022)
Host: dealer.beeline.kz
Content-Length: 1179
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: lastid=2cf786f0-de05-4f48-97c3-94ffc0ee5054; lasturl=/index.wbp; ASP.NET_SessionId=z4pfkifzv01cptiosyg4edud
 
__VIEWSTATE=dDwxNjQxOTc1OTM2O3Q8O2w8aTwxPjs%2BO2w8dDw7bDxpPDQ%2BO2k8Nj47PjtsPHQ8cDxsPFZpc2libGU7PjtsPG88Zj47Pj47Oz47dDw7bDxpPDA%2BOz47bDx0PDtsPGk8MD47aTwyPjs%2BO2w8dDxwPGw8VmlzaWJsZTs%2BO2w8bzxmPjs%2BPjs7Pjt0PDtsPGk8MD47PjtsPHQ8O2w8aTwwPjs%2BO2w8dDw7bDxpPDE%2BO2k8Mz47aTw1PjtpPDc%2BO2k8MzM%2BO2k8NDc%2BO2k8NTM%2BOz47bDx0PHA8bDxocmVmOz47bDwvUmVlc3Rycy9SZWVzdHIvZGVmYXVsdC5hc3B4P3BhcnQ9UmVlc3RycyYxPWFjdGlvbnxTZWFyY2hAaWR8LTFAY29udHJhY3RpZHwtMUBhY3Rpb25iYWNrfE5vbmU7Pj47Oz47dDxwPGw8VmlzaWJsZTs%2BO2w8bzxmPjs%2BPjs7Pjt0PHA8bDxWaXNpYmxlOz47bDxvPGY%2BOz4%2BOzs%2BO3Q8cDxsPFZpc2libGU7PjtsPG88Zj47Pj47Oz47dDxwPHA8bDxWaXNpYmxlOz47bDxvPGY%2BOz4%2BOz47Oz47dDxwPHA8bDxWaXNpYmxlOz47bDxvPHQ%2BOz4%2BOz47Oz47dDxwPGw8aHJlZjs%2BO2w8L1JlZXN0cnMvUmVlc3RyL2RlZmF1bHQuYXNweD9wYXJ0PVJlZXN0cnMmMT1hY3Rpb258Tm9uZUBpZHwtMUBjb250cmFjdGlkfC0xQGFjdGlvbmJhY2t8Tm9uZTs%2BPjs7Pjs%2BPjs%2BPjs%2BPjs%2BPjs%2BPjs%2BPjs%2BPjs%2BqJ73tlTnIvXMt%2FVIEKcRDg%2Bjw7I%3D&_ctl0%3A_ctl0%3AddeSource=Hand&_ctl0%3A_ctl0%3ASelectPaySystem%3AddPaySystem=3&_ctl0%3A_ctl0%3ASelectContractType%3AddContractType=1&_ctl0%3A_ctl0%3AtbeDescription=&_ctl0%3A_ctl0%3AbSave=%D1%EE%F5%F0%E0%ED%E8%F2%FC&_ctl0%3A_ctl0%3AhiddenContractType=
 
 
 
/////////// My Program //////////////////////////////////////////
POST /Reestrs/Reestr/default.aspx?part=Reestrs&1=action%7CCreate@id%7C-1@contractid%7C-1@actionback%7CNone HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: https://dealer.beeline.kz/Reestrs/Reestr/default.aspx?part=Reestrs&1=action|Create@id|-1@contractid|-1@actionback|View
Accept-Language: ru
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: mozilla/4.0 (compatible; msie 7.0; windows nt 6.0; slcc1; .net clr 2.0.50727; media center pc 5.0; .net clr 3.0.04506; infopath.2; .net clr 3.5.21022)
Cookie: ASP.NET_SessionId=wpldsc55runqv445zqmszk45; path=/
Host: dealer.beeline.kz
Content-Length: 1237
 
__VIEWSTATE=dDwxNjQxOTc1OTM2O3Q8O2w8aTwxPjs%252BO2w8dDw7bDxpPDQ%252BO2k8Nj47PjtsPHQ8cDxsPFZpc2libGU7PjtsPG88Zj47Pj47Oz47dDw7bDxpPDA%252BOz47bDx0PDtsPGk8MD47aTwyPjs%252BO2w8dDxwPGw8VmlzaWJsZTs%252BO2w8bzxmPjs%252BPjs7Pjt0PDtsPGk8MD47PjtsPHQ8O2w8aTwwPjs%252BO2w8dDw7bDxpPDE%252BO2k8Mz47aTw1PjtpPDc%252BO2k8MzM%252BO2k8NDc%252BO2k8NTM%252BOz47bDx0PHA8bDxocmVmOz47bDwvUmVlc3Rycy9SZWVzdHIvZGVmYXVsdC5hc3B4P3BhcnQ9UmVlc3RycyYxPWFjdGlvbnxTZWFyY2hAaWR8LTFAY29udHJhY3RpZHwtMUBhY3Rpb25iYWNrfE5vbmU7Pj47Oz47dDxwPGw8VmlzaWJsZTs%252BO2w8bzxmPjs%252BPjs7Pjt0PHA8bDxWaXNpYmxlOz47bDxvPGY%252BOz4%252BOzs%252BO3Q8cDxsPFZpc2libGU7PjtsPG88Zj47Pj47Oz47dDxwPHA8bDxWaXNpYmxlOz47bDxvPGY%252BOz4%252BOz47Oz47dDxwPHA8bDxWaXNpYmxlOz47bDxvPHQ%252BOz4%252BOz47Oz47dDxwPGw8aHJlZjs%252BO2w8L1JlZXN0cnMvUmVlc3RyL2RlZmF1bHQuYXNweD9wYXJ0PVJlZXN0cnMmMT1hY3Rpb258Tm9uZUBpZHwtMUBjb250cmFjdGlkfC0xQGFjdGlvbmJhY2t8Tm9uZTs%252BPjs7Pjs%252BPjs%252BPjs%252BPjs%252BPjs%252BPjs%252BPjs%252BPjs%252BqJ73tlTnIvXMt%252FVIEKcRDg%252Bjw7I%253D&_ctl0:_ctl0:ddeSource=Hand&_ctl0:_ctl0:SelectPaySystem:ddPaySystem=3&_ctl0:_ctl0:SelectContractType:ddContractType=1&_ctl0:_ctl0:tbeDescription=&_ctl0:_ctl0:bSave=%25D1%25EE%25F5%25F0%25E0%25ED%25E8%25F2%25FC&_ctl0:_ctl0:hiddenContractType=

Open in new window

LVL 3
exceterAsked:
Who is Participating?
 
apeterCommented:
So the problem is in getting the viewstate values in windows application ?
0
 
exceterAuthor Commented:
Possibly the problem is in getting the viewstate values, but not sure,
The problem I understand now is that query I built does not work. Even it is similar to query built in IE.
I cant figure out what the problem is
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
apeterCommented:
Only when you post a form in IE you will have viewstate values but when you access a site through a Windows program you can't get view state since you have whole request and you are sole responsible for how to process it.
0
 
exceterAuthor Commented:
Probably promblem is that...
After posting my promblem, I searched internet for VIEWSTATE, and decoded my VIEWSTATE with Base64-Decoder. There is nothing that I can see what may couse problem.
As I said earlier, my problem is that my POST does not work, even it is the same as IE POST.
I need help to make a working POST.
0
 
exceterAuthor Commented:
Hmm, so I do not have to look for VIEWSTATE?
I tried to POST my query without VIEWSTATE, I get the same error (just redirected to Error page)
0
 
apeterCommented:
It is always Requesting a Page. We can't have POSTBACK's if call from Windows Application so we can't have any VIEWSTATE for the FORM.

One other way in windows application is, you can have web browser control in your windows Form and load your Page in that and interact.
0
 
exceterAuthor Commented:
The other way Sounds hopefully...
Could you show a bit of code for Web Browser control in WinForm and interact with that ?
0
 
exceterAuthor Commented:
tnx.
I will accept your answer.

P.S.
I have a combo box in my web-page, could you show how to auto-select value in it and press button?
0
All Courses

From novice to tech pro — start learning today.