473,385 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Assigned ID gets changed! (FindControl not working)

Hi!

I have following problem:

When I create control dynamically and assign ID to it it get's changed if
you look at output HTML.

Because I add this control inside ascx it is prefixed with something like
"ctl0_". Therefore FindControl is not working...

How to deal with this?

Thanks!

Nov 17 '05 #1
1 1268
SOLVED

Since I had code in ASCX ID was prepended with additional ID for ASCX
itself.

Changing Page.FindControl to this.FindControl cured problem.
"Ivan Demkovitch" <i@a.b> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
Hi!

I have following problem:

When I create control dynamically and assign ID to it it get's changed if
you look at output HTML.

Because I add this control inside ascx it is prefixed with something like
"ctl0_". Therefore FindControl is not working...

How to deal with this?

Thanks!

Nov 17 '05 #2

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

Similar topics

1
by: Robert Oschler | last post by:
When a web page I created is bookmarked, for example using Ctrl-D or Right-Click->Add To Favorites in IE, is there a way to intercept and/or change the URL that gets assigned to the bookmark? Any...
8
by: Jason Bell | last post by:
Give the following custom attribute: public class WidgetEventAttribute : System.Attribute { protected Cegui.EventHandler mEventHandler = null; public WidgetEventAttribute( string...
32
by: Marcus | last post by:
We all know that the "gets" function from the Standard C Library (which is part of the Standard C++ Library) is dangerous. It provides no bounds check, so it's easy to overwrite memory when using...
17
by: MLH | last post by:
A97 Topic: If there is a way to preserve the values assigned to global variables when an untrapped runtime error occurs? I don't think there is, but I thought I'd ask. During development, I'm...
0
by: Michael Howes | last post by:
I have a strange "warning" that shows up during design time in my current project. I have a UserControl, which contains a public enum called ViewTypes This UserControl also has a public property...
3
by: Cindy | last post by:
ASP.NET - C# (User Control) I have a drop-down as usercontrol. In the user control's Page_Init , the drop down gets populated. The SelectedItem.Text is retrived using property get The...
2
by: hui | last post by:
Here is a problem I am having with web form designer. I have a database control in the form, and setup the connection string as a dynamic property. It compiles and runs fine. I close the aspx...
3
by: Tom | last post by:
I have a VB .NET application that has a text box with the following code to handle the leave event. Private Sub txtIDiscountRate_TextChanged(ByVal sender As System.Object, ByVal e As...
4
by: | last post by:
I'm building some user controls. I very much like how you can build custom properties to be bound to a user control, and how instances of that control will show those custom properties in the...
280
by: jacob navia | last post by:
In the discussion group comp.std.c Mr Gwyn wrote: < quote > .... gets has been declared an obsolescent feature and deprecated, as a direct result of my submitting a DR about it (which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.