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
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