![]() ![]() |
You should now be at a point where you understand how all the different pieces of ATL Server work together to render content back to the client, so now its time to get into the code and implement the necessary logic for your number-guessing game. The best place to start is with the server response file (SRF).
The SRF is a combination of regular HTML and ATL Server replacement tags. Each tag is contained within beginning and ending double curly braces. Using Solution Explorer, open the NumberGuess.srf file contained within the NumberGuess solution.
The Visual Studio .NET IDE is registered to treat server response files as regular HTML files. SRFs, however, are dynamic in nature, so what you see when you are designing the Web page is not what you'll see when it's rendered by the client Web browser. At the bottom-left area of the main IDE window, you can see two buttons, labeled Design and HTML, on a toolbar. These buttons control how the file is displayed within the IDE when you are working with it. By default, the SRF opens in Design View and shows what the file will look like when rendered. However, as just mentioned, it doesn't have the ability to render the dynamic content, so you'll see the ATL Server tags instead of the content, which will be sent down the response stream by your tag-replacement function.
Click the HTML button to edit the file in straight text mode. What you'll see is the mixing of regular HTML tags and the double curly brace ATL Server tags. Your server response file should appear similar to Listing 14.1.
1: <html> 2: {{// use MSDN's "ATL Server Response File Reference" 3: to learn about SRF files.}} 4: {{handler NumberGuess.dll/Default}} 5: <head> 6: </head> 7: <body> 8: This is a test: {{Hello}}<br> 9: </body> 10: </html>
You can use several different ATL Server tags within the SRF. The full list of available tags is provided in Table 14.1.
![]() ![]() |
Top |