MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual page 101

Developing web applications with coldfusion
Table of Contents

Advertisement

Chapter 7: Reusing Code
<HTML>
<HEAD>
</HEAD>
<BODY>
<!--- Enter a name, which could also be done in a form --->
<!--- This example simply uses a cfset --->
4
<CFSET NameYouEntered="Smith">
<!--- display the current name --->
<CFOUTPUT>
Before you leave this page, you're #NameYouEntered#.<BR>
</CFOUTPUT>
<!--- go to the custom tag --->
4
<CF_GETMD NAME="#NameYouEntered#">
<!--- come back from custom tag --->
<!--- display the results of the custom tag --->
<CFOUTPUT>
You are now #DOCTOR#.
</CFOUTPUT>
</BODY>
</HTML>
3.
Save the page as
4.
Create another new page (the custom tag) in Studio.
5.
Enter the following code:
<HTML>
<HEAD>
</HEAD>
<BODY>
<!--- get the value of the varible NAME from the calling page --->
<!--- put the text "Doctor " in front of the name --->
<!--- create a variable called DOCTOR, make its value "Doctor NAME" -
-->
<!--- and make its scope CALLER so that you can pass it back to the
calling page --->
<CFPARAM VALUE="Attributes.Name" DEFAULT="Who"
<CFSET CALLER.DOCTOR="Doctor " & "#ATTRIBUTES.NAME#">
</BODY>
</HTML>
6.
Save the page as
<TITLE>Enter Name</TITLE>
callingpage.cfm
<TITLE>GetMD Custom Tag</TITLE>
getmd.cfm
.
.
75

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?

This manual is also suitable for:

Coldfusion 4.5

Table of Contents