VBA / Excel - " __doPostBack "

Estevam Guilherme

New Member
Joined
Jul 16, 2015
Messages
9
I'm trying to submit a form on a old asp classic page.

Here some script:

<tbody>
[TD="class: line-content"][ ******** type="text/javascript">[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"]//<=!=[=C=D=A=T=A=[[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"]var theForm = document.forms['aspnetForm'];[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"]if (!theForm) {[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"] theForm = document.aspnetForm;[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"]}[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"]function __doPostBack(eventTarget, eventArgument) {[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"] if (!theForm.onsubmit || (theForm.onsubmit() != false)) {[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"] theForm.__EVENTTARGET.value = eventTarget;[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"] theForm.__EVENTARGUMENT.value = eventArgument;[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"] theForm.submit();[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"] }[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"]}[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"]//]=]=>[/TD]

[TD="class: line-number"][/TD]
[TD="class: line-content"]*********>[/TD]

</tbody>
]

Using Fiddler and navegating manually I got this:


And when I navegates using my code:

<dim sformlogin="" as="" string

sFormParameters = Join(Array( _
"__EVENTTARGET=", _
"__EVENTARGUMENT=", _
"__VIEWSTATE=", _
"__EVENTVALIDATION=", _
"ctl00$ContentPlaceHolder1$acc_Calendario1$myCalendario1$ctl22=17", _
"ctl00$ContentPlaceHolder1$acc_Calendario1$HiddenField1=", _
"__VIEWSTATEGENERATOR=C2EE9ABB", _
"__VIEWSTATEENCRYPTED"), "&")

Call IE.document.parentWindow.execScript("javascript: __doPostBack('sFormParameters')", "JavaScript")>

I have this: But it's not working.



How can set the parameters to get this working</dim>
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,223,698
Messages
6,173,901
Members
452,536
Latest member
Chiz511

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top