View comments | RSS feed

Defining application variables for ASP and ColdFusion

In ASP and ColdFusion, you can use application variables to store and display information that is maintained for the lifetime of the application and persists from user to user.

To define an application variable for a page:

  1. Open a dynamic document type in the Document window.
  2. Select Window > Bindings to display the Bindings panel.
  3. Click the Plus (+) button and select Application Variable from the pop-up menu.
  4. Enter the name of the variable as defined in the application's source code.
  5. Click OK.

    The application variable appears in the Bindings panel under the Application icon.



    Once you define the application variable, you can use its value in a page. For more information, see Adding Dynamic Content to Web Pages.

Related topics:


Comments


No screen name said on Jul 23, 2007 at 3:24 PM :
Content on this page http://livedocs.adobe.com/dreamweaver/8/using/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=35_con18.htm is WRONG. Variables are not listed on Application Bindings window, at least for asp applications.
chucknado said on Jul 24, 2007 at 11:19 AM :
Verified that it worked for me. Did you add the variables first as described in steps 3 and 4? You should already have a variable defined in your code -- e.g., <% Application("Counter") = 25 %>). Using the example, in step 4 you would call the variable "Counter".
chucknado said on Jul 24, 2007 at 1:02 PM :
Ah, my comments were for ASP pages. The panel doesn't support application variables in ASP.NET pages -- only CF and ASP. I'm not sure why.
No screen name said on Jul 24, 2007 at 12:37 PM :
Thanks Chuck. Putting in the Application variable declaration didn't make a difference. When I click the +, The only menuitems under binding are Dataset and Stored Procedure. Trying to request a computational variable (e.g., Counter) or a UI variable (txtField.Text) results in a null value.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/dreamweaver/8/using/35_con18.htm