automatic form submission

P

Piotr Kurpiel

Hi,
I am creating a site where I need to refer to another external file
(aspx).
I create the form and works fine. But as soon as I try to submit the
form automatically (with form.submit()) I get an error from the
external site. I do not have the code of that site but suppose that my
automatic submission does not pass all of the variables. This is how
it looks in plain html:

<form name="Login" method="post"
action="http://ims.ukro.ac.uk/UKRO/login.aspx" id="Login">

<input type="hidden" name="__EVENTTARGET" value="LoginCommand" />

<input type="hidden" name="__VIEWSTATE"
value="dDwtODMyMTc4OTc4O3Q8O2w8aTwwPjtpPDE+Oz47bDx0PHA8bDxUZXh0Oz47bDxMb2dpbjs+Pjs7Pjt0PDtsPGk8MT47aTwzPjs+O2w8dDw7bDxpPDE+Oz47bDx0PHA8bDxUZXh0Oz47bDxcPHNwYW4gY2xhc3M9J2NvcnBvcmF0ZUh5cGVyTGlua1NlcGFyYXRvcidcPiBcPiBcPC9zcGFuXD5cPGJcPlw8Zm9udCBmYWNlPUFyaWFsIHNpemU9MyBjb2xvcj0jMDAwMDAwXD5JTVMgTG9naW5cPC9mb250XD5cPC9iXD47Pj47Oz47Pj47dDw7bDxpPDA+Oz47bDx0PDtsPGk8MD47PjtsPHQ8O2w8aTwxPjs+O2w8dDw7bDxpPDE+O
k8Mz47aTw1PjtpPDY+O2k8OT47aTwxMD47PjtsPHQ8cDxwPGw8VGV4dDs+O2w8VXNlciBuYW1lOjs+Pjs+Ozs+O3Q8cDxwPGw8VGV4dDs+O2w8UGFzc3dvcmQ6Oz4+Oz47Oz47dDxwPHA8bDxUZXh0Oz47bDxMb2dpbjs+Pjs+Ozs+O3Q8cDxsPHZhbHVlOz47bDxSZXNldDs+Pjs7Pjt0PHA8cDxsPFRleHQ7PjtsPEZvcmdvdCB5b3VyIHBhc3N3b3JkPzs+Pjs+Ozs+O3Q8cDxwPGw8TmF2aWdhdGVVcmw7VGV4dDs+O2w8aHR0cDovL2ltcy51a3JvLmFjLnVrL1VLUk8vRm9yZ290UGFzc3dvcmQuYXNweD9Vc2VyUHJlZj1jdWx0dXJlJT
FZW4tR0I7Y2xpY2sgaGVyZTs+Pjs+Ozs+Oz4+Oz4+Oz4+Oz4+Oz4+Oz4+Oz6uA2VLC+u3KZvM2xD7WM8FhSqygw=="
/>

<input name="LoginForm1:UserName" type="hidden" maxlength="50"
id="LoginForm1_UserName" value="username" style="width:150px;" />

<input name="LoginForm1:password" type="hidden" maxlength="50"
id="LoginForm1_Password" value="password" style="width:150px;" />

<input name="Submit" type="hidden" maxlength="50"
id="LoginForm1_LoginCommand" value="LoginForm1:LoginCommand" />

<input type="Submit" name="LoginForm1:LoginCommand" value="GO"
id="LoginForm1_LoginCommand" />
</form>


And now I realised thet sometimes it doesn't even work with manual
submission but sometimes does.

Do you have any suggestions?
 
E

Erwin Moller

Piotr said:
Hi,
I am creating a site where I need to refer to another external file
(aspx).
I create the form and works fine. But as soon as I try to submit the
form automatically (with form.submit()) I get an error from the
external site. I do not have the code of that site but suppose that my
automatic submission does not pass all of the variables. This is how
it looks in plain html:

<form name="Login" method="post"
action="http://ims.ukro.ac.uk/UKRO/login.aspx" id="Login">

<input type="hidden" name="__EVENTTARGET" value="LoginCommand" />

<input type="hidden" name="__VIEWSTATE"
value="dDwtODMyMTc4OTc4O3Q8O2w8aTwwPjtpPDE+Oz47bDx0PHA8bDxUZXh0Oz47bDxMb2dpbjs+Pjs7Pjt0PDtsPGk8MT47aTwzPjs+O2w8dDw7bDxpPDE+Oz47bDx0PHA8bDxUZXh0Oz47bDxcPHNwYW4gY2xhc3M9J2NvcnBvcmF0ZUh5cGVyTGlua1NlcGFyYXRvcidcPiBcPiBcPC9zcGFuXD5cPGJcPlw8Zm9udCBmYWNlPUFyaWFsIHNpemU9MyBjb2xvcj0jMDAwMDAwXD5JTVMgTG9naW5cPC9mb250XD5cPC9iXD47Pj47Oz47Pj47dDw7bDxpPDA+Oz47bDx0PDtsPGk8MD47PjtsPHQ8O2w8aTwxPjs+O2w8dDw7bDxpPDE+O
k8Mz47aTw1PjtpPDY+O2k8OT47aTwxMD47PjtsPHQ8cDxwPGw8VGV4dDs+O2w8VXNlciBuYW1lOjs+Pjs+Ozs+O3Q8cDxwPGw8VGV4dDs+O2w8UGFzc3dvcmQ6Oz4+Oz47Oz47dDxwPHA8bDxUZXh0Oz47bDxMb2dpbjs+Pjs+Ozs+O3Q8cDxsPHZhbHVlOz47bDxSZXNldDs+Pjs7Pjt0PHA8cDxsPFRleHQ7PjtsPEZvcmdvdCB5b3VyIHBhc3N3b3JkPzs+Pjs+Ozs+O3Q8cDxwPGw8TmF2aWdhdGVVcmw7VGV4dDs+O2w8aHR0cDovL2ltcy51a3JvLmFjLnVrL1VLUk8vRm9yZ290UGFzc3dvcmQuYXNweD9Vc2VyUHJlZj1jdWx0dXJlJT
FZW4tR0I7Y2xpY2sgaGVyZTs+Pjs+Ozs+Oz4+Oz4+Oz4+Oz4+Oz4+Oz4+Oz6uA2VLC+u3KZvM2xD7WM8FhSqygw=="
/>

<input name="LoginForm1:UserName" type="hidden" maxlength="50"
id="LoginForm1_UserName" value="username" style="width:150px;" />

<input name="LoginForm1:password" type="hidden" maxlength="50"
id="LoginForm1_Password" value="password" style="width:150px;" />

<input name="Submit" type="hidden" maxlength="50"
id="LoginForm1_LoginCommand" value="LoginForm1:LoginCommand" />

<input type="Submit" name="LoginForm1:LoginCommand" value="GO"
id="LoginForm1_LoginCommand" />
</form>


And now I realised thet sometimes it doesn't even work with manual
submission but sometimes does.

Do you have any suggestions?


Hi,

I strongly suspect that that other server EXPECTS you to have some state, eg
in a session, or by passing that monstrous __VIEWSTATE content.
Go study the setup would be my advise.

Hard to say how to fix it with the given information.

Regards,
Erwin Moller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top