Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

VBSCRIPT with autopostback - VS2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JohnHorb - 21 Aug 2007 09:32 GMT
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.
ca8msm@aspnetlibrary.com - 21 Aug 2007 09:55 GMT
Do your client side <script> tags specify the type? e.g.

<script type="text/vbscript">

</script>
JohnHorb - 21 Aug 2007 10:16 GMT
> Do your client side <script> tags specify the type? e.g.
>
> <script type="text/vbscript">
>
> </script>

Yes. as I say, the annoying thing is it all worked fine in VS2003.
JohnHorb - 21 Aug 2007 18:30 GMT
> > Do your client side <script> tags specify the type? e.g.
> >
[quoted text clipped - 3 lines]
>
> 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).

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.