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 November 18th, 2004, 11:48 PM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tranfer variable from server to vbscript

I want to tranfer varibale from asp to vb script
Example :
temp1.asp

....
<%
a = request.querystring("id")
%>
.....
<script ID=serverEventHandlersVBS language=vbscript Runat=server>

sub cmdsave_onclick()
Response.write(a)

end sub
</script>

---------------
I don't show variable a . Can you help me, and show me how to ?
If you can send me script to show the problem ? thank you ..

Sorry for my stock of vocabulary , i'm form vietnam . :-)









 
Old November 19th, 2004, 12:55 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Good day thanhhai_ktm

Providing request.querystring("id") has a value the code you have above should work with a small adjustment.

I will asume the code above is located on a page called temp1.asp this means that the page posting to this page needs a value passed against the QS variable "ID" An example of this would be:
<a href="temp1.asp?ID=aValue">Click here</a>

Then when temp1.asp loads the following will appear in the address bar:
temp1.asp?ID=aValue
NOTE: If there is no value after the = sign 'a' will never have a value, it will be = to an empty string

;;;I don't show variable a . Can you help me, and show me how to ?
Change the code you have illustrated above to:

------------------cut n paste code-------------------
<% OPTION EXPLICIT %>
<% if request.querystring("id") <> "" then
     dim a
     a = request.querystring("id")
     response.write a
else
     response.write "The query string named ID has no value"
end if
%>
------------------cut n paste code-------------------



Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change ASP variable in VBScript jimusa Classic ASP Basics 1 August 13th, 2008 07:08 PM
vbscript + xsl:variable lscjtw XSLT 9 August 2nd, 2007 11:44 AM
How To Pass Javascript variable to vbscript pbcatan Classic ASP Databases 1 December 18th, 2006 08:42 AM
Tranfer sql database from one machine to another Israr SQL Server 2000 10 February 28th, 2005 06:54 AM





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