Remembering Controls' Locations

D

Don Wash

Hi There!

I'm creating reusable ASCX files for my whole site. My site has many
sections and sub-sections and sub-sub-sections. So I find it hard to declare
controls in the ASPX page.

Naturally this is how I have to declare the controls on ASPX pages that
resides in the same folder with the ASCX control...

<%@ Register TagPrefix="ControlType" Src="ControlFileName.ascx"
TagName="ControlName" %>

For any ASPX pages that resides in a sub-folder, it goes...

<%@ Register TagPrefix="ControlType" Src="../ControlFileName.ascx"
TagName="ControlName" %>

Notice the "../" in the second declaration.

The problem arises...
- When the file name of the control is changed, I have to update every
single ASPX that references it.

- Or worse when the location of the ASPX file (or the folder with all the
ASPX files) that reference the control is changed to another folder, I need
to go every single ASPX page in that folder and make sure there is
appropriate number of "../" in the Src attribute of the Register tag.

- Or worst when the location of the control has to be moved, I have to now
go through every ASPX file and make sure there is appropriate number of
"../" in the Src attribute of the Register tag.


Is there any ways to workaround this problem? Or am I stuck with this?!

Many thanks!
Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top