Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Referencing a user control from another directory


Message #1 by "Oliver, Wells" <WOliver@l...> on Tue, 13 Aug 2002 10:29:36 -0700
I have a top-level directory called /controls and it includes a few ACSX
files for the site. Each subfolder I make (a new application) needs to
reference these.

How can I reference them in a new subfolder? In the 'old day's I'd just
<!--#include virutal="../controls/whatever.ssi"--> but those days are behind
us.

Thanks!

Wells Oliver
Web Application Programmer
Leviton Voice & Data
xxx-xxx-xxxx
http://www.levitonvoicedata.com

Message #2 by Imar Spaanjaars <Imar@S...> on Tue, 13 Aug 2002 19:43:12 +0200
Well, those days aren't completely behind us:

Try this:

<%@ Register TagPrefix="MyPrefix" TagName="MyTagName" 
Src="/controls/myControl.ascx" %>

Then in the page use this:

<MyPrefix:MyTagName id="idMyTagName" runat="server" />

By using the / in the src attribute, all pages are able to find the "root" 
of the site containing the "controls" directory.


HtH

Imar



At 10:29 AM 8/13/2002 -0700, you wrote:
>I have a top-level directory called /controls and it includes a few ACSX
>files for the site. Each subfolder I make (a new application) needs to
>reference these.
>
>How can I reference them in a new subfolder? In the 'old day's I'd just
><!--#include virutal="../controls/whatever.ssi"--> but those days are behind
>us.
>
>Thanks!
>
>Wells Oliver
>Web Application Programmer
>Leviton Voice & Data
>xxx-xxx-xxxx
>http://www.levitonvoicedata.com
>
>
>---
>
>ASP.NET 1.0 Namespace Reference with C#
>http://www.wrox.com/acon11.asp?ISBN=1861007442
>
>ASP.NET 1.0 Namespace Reference with VB.NET
>http://www.wrox.com/acon11.asp?ISBN=1861007450
>
>These books are a complete reference to the ASP.NET namespaces
>for developers who are already familiar with using ASP.NET.
>There is no trivial introductory material or useless .NET
>hype and the presentation of the namespaces, in an easy-to use
>alphabetical order ensures a user-friendly reference format.
>We provide in-depth coverage of all the major ASP.NET classes,
>giving you those real-world tips that the documentation doesn't
>offer, and demonstrating complex techniques with simple
>examples.
>
>---



  Return to Index