Postback from VBScript

G

Guest

Hi

I have an asp.net page with embedded vbscript that interacts with Microsoft
Word.
The script is activated by a client side button (onClick()...).

When the script has finished I want to notify the server so that some
cleaning up can be done. I can't find a way to do a postback from vbscript. I
have added another button and run it's click method but it didn't post back
(I don't know how to get the event chain working). I tried calling a
javascript routine to do a __postback("","") etc.

Any help - I'm stuck on this one.

David
 
G

Guest

The quick and dirty method would be to convert the __dopostback to vbscript.
change any [] to () - remove the ; and put a vbscript style function
declaration and replace { } with appropriate vb tags.
there is nothing in the postback event that is javascript specific that i am
aware of.
 
G

Guest

Hi Thanks for reply.
It got me thinking.

What I have actually done is simply
document.all("MyHiddenField").value = "Finished"
document.myForm.submit()

Then the aspx simply loks in the posted back value of MyHiddenField to
decide whether to do the cleanup. I tried to set a Target and Value for the
submit but any Target other than "" caused a second instance of my page to be
created(!).
Any Value seemed to be completely ignored.
Anyway, got a result.

Thanks again.

David



The quick and dirty method would be to convert the __dopostback to vbscript.
change any [] to () - remove the ; and put a vbscript style function
declaration and replace { } with appropriate vb tags.
there is nothing in the postback event that is javascript specific that i am
aware of.



David said:
Hi

I have an asp.net page with embedded vbscript that interacts with
Microsoft
Word.
The script is activated by a client side button (onClick()...).

When the script has finished I want to notify the server so that some
cleaning up can be done. I can't find a way to do a postback from
vbscript. I
have added another button and run it's click method but it didn't post
back
(I don't know how to get the event chain working). I tried calling a
javascript routine to do a __postback("","") etc.

Any help - I'm stuck on this one.

David
 
M

marc.derider

Yep. That is basically what the do_postback does except it provides a
more standardized method of doing it.
 

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

Top