Application variable

Results 1 to 2 of 2

Thread: Application variable

  1. #1
    Join Date
    Dec 1969

    Default Application variable

    Dear friends,<BR>I have a simple problem.<BR>In my global.asa file, i have a sub.<BR><BR>SUB APPLICATION_ONSTART<BR>Application("ConnectionStri ng") = "DRIVER=SQL "<BR>END SUB<BR><BR>i am trying to get the value of the variable in one of my asp file. By giving the following command but it gives nothing.<BR>alert(Application("ConnectionString")) <BR>Can someone tell me whats my mistake.<BR>Both the global.asa file and asp file are located on same path.

  2. #2
    Join Date
    Dec 1969

    Default RE: Application variable

    I&#039d guess that you are trying to display the Application setting in a client-side JavaScript code block? There are some issues when communicating information between server-side script and client-side script... I HIGHLY suggest that you read this article:<BR><BR>ASP Basics: What&#039s Happening Back There?<BR><BR><BR>To answer your question, this should work (assuming that this is appearing in a client-side JavaScript block):<BR>&#060;script language="JavaScript"&#062;<BR>&#060;!--<BR> alert(&#039&#060;%=Application("ConnectionString") %&#062;&#039);<BR>// --&#062;<BR>&#060;/script&#062;<BR><BR>Happy Programming!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts