473,508 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remembering Controls' Locations

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
Nov 18 '05 #1
1 1204
TJS
http://www.informit.com/articles/art...01145&seqNum=2


"Don Wash" <do*@wash.com> wrote in message
news:ey**************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1563
by: Steve | last post by:
Visual Studio 2003 .Net / C# I have a 2 page Tab Control for users to add a Job in my application. The first page is for them to choose which type of Job they would like. The type of Job...
0
1026
by: Yahoo | last post by:
Dynamic controls dont remember their viewstate if not added during onInit. I was wondering dynamic controls cannot be added during 'void LoadViewState(object savedState)'? If child controls were...
0
1235
by: Davey P | last post by:
I have an asp.net table which I am populating with controls dynamically at runtime. The controls themselves get/set values in a datatable which is stored in viewstate over postbacks. Here is...
14
1967
by: 97T | last post by:
Well this is still bugging me. I know there are other ways around this, but for a number of reasons I would like to be able to do this one simple thing. I have a form with a number of controls...
0
952
by: BodeColander | last post by:
Hello, I'm working on a user control (control A) that contains many controls within it (textboxes, a radio button, listboxes, comboboxes and a button - as well as a whack of labels). During a...
1
3036
by: FredC | last post by:
I'm using VS 2003, C#.Net 2003. I built a simple windows form app. with the following attributes: - has a BackgroundImage set to a jpeg I built a very simple user control that contains a...
1
6432
by: CharChabil | last post by:
Hello Guys, I am trying to mark locations on a map (x,y pixels are derived from a DB) This is the code that i am using Private Sub DisplayOnSoftMap() SqlQuey = "Select * FROM SoftwareMap WHERE...
19
1813
by: ThatsIT.net.au | last post by:
I come from a classic asp background, but have started using ASP.NET about 12 months ago, but I'm still not sure about the pros and cons of using controls v HTML spat out from code as you would in...
2
4235
by: =?Utf-8?B?TG91aXNhOTk=?= | last post by:
Hello. ive just read some posts on the age old issue of losing dynamic control values on postback. Most people say recreate the controls on the onInit, but i just dont think this serves my purpose....
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.