VBSCRIPT with autopostback - VS2005

G

Guest

I have a problem with client-side VBSCRIPT on a page with auto-postback
controls.
I have generated a simple page with a listbox, set to autopostback. This
works OK. If I then generate some client-side VBSCRIPT, VS creates a VBSCRIPT
script block. Even if I delete everything within the block, just leaving the
<script> </script> tags, I get an error on the page if I click an item in the
list box. If I use JScript, rather than VBScript, I don;t see the issue. This
was all working with VS2003, but not with 2005. The only difference I can
see, is that, for the postback, VS2005 generates

javascript:settimeout(__DoPostback(...),0)

whereas VS2003 does not generate the settimeout:-

javascript:__DoPostback(...)

Anyone come across this problem? I'm converting quite a large VS2003 app to
VS2005, and don't really want to have to rewrite all my client-side scripts
in JScript.
 
C

ca8msm

Do your client side <script> tags specify the type? e.g.

<script type="text/vbscript">

</script>
 
G

Guest

JohnHorb said:
Yes. as I say, the annoying thing is it all worked fine in VS2003.

Well after some hours of hard googling, found that the answer is to move the
vbscript block from the top of the file, where VS2005 puts it, to after the
</body> tag. (I suspect the crtical thing is to ensure it goes after the
jscript __DoPostback block).
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top