View Full Version : include aspx

04-02-2007, 07:51 PM
Hey guys, I want to include my config.aspx which consists of my database username and password in it into my getData.aspx Below is what I have so far, but it's not working as expected.

<%@ Page Language="VB" AutoEventWireup="false" AspCompat=true %>
<!-- #Include File="config.aspx" -->

If conn.errors.count = 0 Then

Response.Write("Connected OK")

End If


04-02-2007, 10:33 PM
This is old ASP style.
Use web.config for this information for aspx pages. Then you don't include anything except the proper directory.
i.e. using System.Configuration;

04-02-2007, 10:34 PM
Here is a sample from my Northwind test site web.config

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<add name="NORTHWIND" connectionString="integrated security=SSPI;data source=myServerName;persist security info=True;initial catalog=NORTHWIND;" providerName="System.Data.SqlClient"/>