473,795 Members | 2,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NamingContainer property on UserControl

Hi

We have ported a .NET1.1 ASP.NET app to .NET2. All our user controls have
been modified and I have found some strange behavior. Firstly I can see
that the controls now get rendered at compile time instead of declaring them
in the ascx.cs file. Then strange thing is: in our aspx page when we call
Page.LoadContro l(usercontrol) all the controls within the usercontrol dont
get their unique ID ie ctl1_btnDetails etc except each repetition of the
control get ID="btnDetails " so therefore none of the events work etc.

The way I alleviated this problem is stange. After the
Page.LoadContro l(usercontrol) I set:
usercontrol.Nam ingContainer.ID = "anythinghe re" and then all the subcontrols
get ID's etc correctly.

Can someone explain this behavior?

TIA
Rob
May 25 '06 #1
0 1051

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

Similar topics

4
2039
by: DraguVaso | last post by:
Hi, I'm having some weird behaviour, and I can't find any solution to this. I made a UserControl (uclCommands) which contains a Toolbar (ToolBar1) with Modifiers = Public. I put this usercontrol on my form and call it Ucl1. In the Property Window in the Windows Forms Designer I change Ucl1.ToolBar1.ButtonSize to a bigger value.
1
1748
by: Alex Bibiano | last post by:
I have a winform with a new property. The property type is UserControl. This is my code fro the property: private UserControl userControlDetalle; public UserControl UserControlDetalle { get { return userControlDetalle; } set { userControlDetalle = value;
3
1691
by: Iain | last post by:
Hi I have page (testCal.aspx) that contains a usercontrol (custCalendar.ascx) - see below signature for code. The UC contains a linkbutton which which when clicked, posts back and displays a calendar. When a value in the calendar is selected it posts back and then updates a public property (CurrentDate) on the UC. Note that 2 postbacks occur. I have been attempting to access the public property on the UC, from the page (testCal) shown...
8
2186
by: msmail.microsoft.com | last post by:
Hi, UserControl inherits from TemplateControl which implements the NamingContainer interface. This causes all the controls inside a UserControl to have unique names. If my project, this is Not A Good thing, as I need the names of the form controls to be what I set them to be and not be changed. Does anyone have any idea how to eliminate this behavior?
5
1360
by: darrel | last post by:
I'm still a bit stumped on how to load a usercontrol, and then pass a property value (or variable value) to it. Here's what I'm using to load the UC: localCUstomControl.ascx.vb ------------------------------------- sub initializeExtraControls() panel_controlHolder.visible = True customContentControl = CType(Page.LoadControl("../usercontrols/" &
6
1874
by: Altman | last post by:
I would like to use an indexed property to access my private array of user controls. If I don't use an indexed property, the property will show up in my Properties Window during development. Is there a way to get this to show up in the properties window?
1
6873
by: Will Gillen | last post by:
I know this has probably been asked before, but I can't seem to find a solid answer in any of the archives. First, before my question, please forgive my limited knowledge of the event lifecycle and page loading/rendering lifecycle.... Ok, now for the question: I have an ASPX page (page.aspx), and I have a UserControl (control.ascx). The UserControl has one textbox on the control, and one button control. I have added a public property...
2
2229
by: Tumurbaatar S. | last post by:
I dynamically add columns to DataGrid as described in MSDN articles "Top Questions about the DataGrid Web Server Control" and "Creating Web Server Control Templates Programmatically". The columns are template based and all they use a same template producer. In the edit mode (ListItemType.EditItem) the template adds textbox and validator controls to a column as: public void InstantiateIn(System.Web.UI.Control container) { TextBox tb =...
0
1222
by: Rob Blij | last post by:
Hi (sorry for repeated question) We have ported a .NET1.1 ASP.NET app to .NET2. All our user controls have been modified and I have found some strange behavior. Firstly I can see that the controls now get rendered at compile time instead of declaring them in the ascx.cs file. Then strange thing is: in our aspx page when we call Page.LoadControl(usercontrol) all the controls within the usercontrol dont get their unique ID ie...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10443
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10002
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9044
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6783
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2921
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.