Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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 October 16th, 2004, 05:30 AM
Authorized User
Join Date: Dec 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sasidhar79
Default Accessing ASP variable from Javascript

Hello ,

I have an ASP code, I am unable to access the values of the ASP server side variables in Javascript using <%= %> tags, please let me know what can prevent this kind of behaviour.


Old October 16th, 2004, 11:34 AM
Friend of Wrox
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts

You should be able to like this:

<script type='text/javascript>
var variable = '<%=variable%>';


-Snib <><
Try new FreshView 0.2!
There are only two stupid questions: the one you don't ask, and the one you ask more than once ;)
Old March 8th, 2017, 05:31 PM
Registered User
Join Date: Mar 2017
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts

just adding one thing you can't pass asp variable unless the destination file is also asp not htm or it cant read the result of variable you included in your file

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
set a asp variable with a value in Javascript crmpicco Javascript How-To 6 March 11th, 2005 11:07 AM
set a asp variable with a value in Javascript crmpicco Classic ASP Basics 3 March 10th, 2005 10:46 AM
Javascript variable values into ASP phungleon Classic ASP Basics 2 May 13th, 2004 02:10 PM

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