Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 11th, 2003, 05:46 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to get a VBScirpt variable in ASP??

Hi! I have a VBScript code to check the existing printers installed

<script language="VBScript" type="text/VBScript">
Dim objPrinters
Set WshNetwork = CreateObject("WScript.Network")

Set objPrinters = WshNetwork.EnumPrinterConnections

For i = 0 to objPrinters.Count - 1 Step 2

Msgbox objPrinters.Item(i+1)

Next
</script>

However, I want to show the results (objPrinters.Item) on the the ASP webapge, but if i use <%response.write(objPrinters.item())%>, it does not work, it cannot get the VBScript varible, what can i do ???please help and thanks.:(

 
Old July 13th, 2003, 08:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your VBscript is running *client* side. ASP runs *server* side. You need to transfer the variables from the client side to the server side. This typically occurs one of two ways. You could generate an HTML form and POST the form, or you could pass the values through in the querystring.

regards
David Cameron





Similar Threads
Thread Thread Starter Forum Replies Last Post
storing Javascript variable to ASP variable rupen Classic ASP Basics 5 April 10th, 2007 07:06 AM
assign javascript variable to asp variable manjunath_c_k Classic ASP Basics 1 September 14th, 2006 07:35 AM
Variable from ASP,NET to C# aowen355 ASP.NET 1.x and 2.0 Application Design 3 July 20th, 2005 12:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.