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:
[ ******** type="text/javascript">
//<=!=[=C=D=A=T=A=[
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]=]=>
*********>

<tbody>
</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

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,215,943
Messages
6,127,814
Members
449,409
Latest member
katiecolorado

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