By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,408 Members | 1,796 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,408 IT Pros & Developers. It's quick & easy.

Problems Including Files For URL redirect

P: n/a
For the next couple of months I am hosting 2 domains with one host
(Brinkster). What I have done is setup a page called default.aspx and a
select case for SiteNameURL = Request.ServerVariables("SERVER_NAME").
The only way I can get this to work is to use Response.Redirect for one
of the domains. I can include a file (Index.aspx) just fine for domain
B. When I attempt to include a file for Domain B I get errors such as:

The Connection Property Has Not Been set
There can only be one page directive

These errors are so ambiguous that I don't even know where to start.
The Connection Property error happens when I use:

<!--#Include Virtual="/path/file.aspx"-->

I have also tried using Server.Transfer but end up getting red x's for
images, dead-end hyperlinks, and sometimes the page directive error.

I have been dealing with this for about 2 weeks and I have run out of
ideas. Thanks in advance.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You are getting
There can only be one page directive because you are including a page which has a page directive
into another page which also has a page directive.

You should not include an aspx files into another aspx file.

Use user or custom controls for HTML content,
and compile your functions, if you have them, to an assembly.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Will Chamberlain" <wi**************@devdex.com> wrote in message
news:Oi**************@tk2msftngp13.phx.gbl... For the next couple of months I am hosting 2 domains with one host
(Brinkster). What I have done is setup a page called default.aspx and a
select case for SiteNameURL = Request.ServerVariables("SERVER_NAME").
The only way I can get this to work is to use Response.Redirect for one
of the domains. I can include a file (Index.aspx) just fine for domain
B. When I attempt to include a file for Domain B I get errors such as:

The Connection Property Has Not Been set
There can only be one page directive

These errors are so ambiguous that I don't even know where to start.
The Connection Property error happens when I use:

<!--#Include Virtual="/path/file.aspx"-->

I have also tried using Server.Transfer but end up getting red x's for
images, dead-end hyperlinks, and sometimes the page directive error.

I have been dealing with this for about 2 weeks and I have run out of
ideas. Thanks in advance.

Nov 19 '05 #2

P: n/a
Thanks for the reply Juan. I will be able to test this later this
evening. Just to be sure, instead of including the file as a SSI I
should include it as a usercontrol?

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #3

P: n/a
re:
I should include it as a user control?
Exactly, Will.

If you run into problems doing that, post back!

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Will Chamberlain" <wi**************@devdex.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Thanks for the reply Juan. I will be able to test this later this
evening. Just to be sure, instead of including the file as a SSI I
should include it as a user control?

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.