Solved

__VIEWSTATE - how to know its value ?

Posted on 2009-04-08
9
822 Views
Last Modified: 2012-08-14
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

0
Comment
Question by:exceter
  • 5
  • 4
9 Comments
 
LVL 25

Expert Comment

by:apeter
ID: 24104660
So the problem is in getting the viewstate values in windows application ?
0
 
LVL 3

Author Comment

by:exceter
ID: 24107689
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
 
LVL 25

Expert Comment

by:apeter
ID: 24128003
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
 
LVL 3

Author Comment

by:exceter
ID: 24129248
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 3

Author Comment

by:exceter
ID: 24129272
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
 
LVL 25

Expert Comment

by:apeter
ID: 24130925
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
 
LVL 3

Author Comment

by:exceter
ID: 24131384
The other way Sounds hopefully...
Could you show a bit of code for Web Browser control in WinForm and interact with that ?
0
 
LVL 25

Accepted Solution

by:
apeter earned 200 total points
ID: 24135003
0
 
LVL 3

Author Comment

by:exceter
ID: 24135258
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now