Wrox Programmer Forums
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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 March 14th, 2006, 01:34 PM
Join Date: Jul 2005
Posts: 317
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.NET and SSI

This is what I'm trying to setup:

'Declare main form variable
Dim page_id As String = "login" 'Static test variable
'Dim page_id As String = trim(Request.Form("page_id")) 'Dynamic variable to be used
If page_id = "login" Then

End If

'Declare variables
'Dim page_title As String
Dim page_description As String
Dim page_content As String

'Response.Write("test") 'TEST

'Page title
Dim page_title As String = "Login Page"

'Page description
page_description = "This is the login page."

'Page content
page_content = "This the content for the login page."

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" aspcompat="true" Debug="true" %>
Response.Write("<title>" + page_title + "</title>")

Resulting Error
Compilation Error
Compiler Error Message: BC30451: Name 'page_title' is not declared.

...and when I add <% Response.Write("test") %> to page2.aspx, and comment out the <% Response.Write("<title>" + page_title + "</title>") %>, I don't receive that error and the "test" does get written out. So I know that the page setup is working. I'm just not sure why the last display page (page3.aspx) is not seeing the variable from the SSI.

I'm using this setup so that I can have one SSI that contains other SSI's that actually contain each page's data. I'll then pull each of the page's data using <%Dim page_id As String = trim(Request.Form("page_id"))%> on page1.aspx.

If anyone could let me know what I'm doing wrong, it would be great. Thanks.

Old March 21st, 2006, 11:47 PM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

First you have a syntax error on page3 you have an opening brace but no closing brace on line 2. Second, your compiler is barking at you because you haven't declared page_title. You declared it on page2 but not on page3 and you have not provided a link between the 2 pages, either via Session State, App State, QueryString, or include. In the above example you would need to place on page3 for those variables to be viewed.

"The one language all programmers understand is profanity."

Similar Threads
Thread Thread Starter Forum Replies Last Post
SSI includes in XSLT nrane26 XSLT 1 January 7th, 2005 04:51 AM
Tomcat 5 with SSI ... HELP! HELP! HELP! soxar HTML Code Clinic 1 June 13th, 2004 12:52 AM
SSI funnies aware HTML Code Clinic 18 March 3rd, 2004 03:18 PM
Response.Write an SSI hcweb Classic ASP Basics 2 November 2nd, 2003 05:21 PM
ASP SSI Includes from parent directory ALoPresto Classic ASP Basics 1 August 4th, 2003 02:19 AM

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