473,671 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

findcontrol is nuts!

What gives?
These two controls are right next to each other in a usercontrol, yet in the
code-behind
Can't find:
Dim summaryx As HiddenField = FormView1.FindC ontrol("Summary 2")

Can find:

Dim PlaceHolderPric e2 As PlaceHolder =
FormView1.FindC ontrol("Placeho lderPrice2")

Nov 29 '06 #1
2 1058
Just keep in mind that FindControl looks only in its Controls collection. It
can't find controls in Controls collections of children controls. In your
case PlaceholderPric e2 is likely located inside some other control.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Mr. SweatyFinger" <sw@sw1finger.c omwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
What gives?
These two controls are right next to each other in a usercontrol, yet in
the code-behind
Can't find:
Dim summaryx As HiddenField = FormView1.FindC ontrol("Summary 2")

Can find:

Dim PlaceHolderPric e2 As PlaceHolder =
FormView1.FindC ontrol("Placeho lderPrice2")

Nov 29 '06 #2
In what way do you mean "next to each other?" Can you post some code?

--
HTH,

Kevin Spencer
Microsoft MVP
Logostician
http://unclechutney.blogspot.com

Parabola is a mate of plane.
"Mr. SweatyFinger" <sw@sw1finger.c omwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
What gives?
These two controls are right next to each other in a usercontrol, yet in
the code-behind
Can't find:
Dim summaryx As HiddenField = FormView1.FindC ontrol("Summary 2")

Can find:

Dim PlaceHolderPric e2 As PlaceHolder =
FormView1.FindC ontrol("Placeho lderPrice2")

Nov 29 '06 #3

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

Similar topics

1
7759
by: James G. Beldock | last post by:
I have seen the following behavior: when issuing a Page.FindControl() for a control which exists in an item template (from within an ItemDataBound() event, for example), I get nulls back regularly. Has anyone seen this before? It's pretty aggravating to have to iterate through the controls in each grid cell to find the ones I need, especially since finding those cells is not always easy. Here's my ItemDataBound() handler: private void...
2
6564
by: christof | last post by:
How to do it: My page: <asp:DataList ID="dataListRoleMembers" ...> .... <FooterTemplate> <asp:LinkButton ID="btnAddMember" runat="server" OnClick="btnAddMember_Click">Add...</asp:LinkButton> <asp:TextBox ID="txtAddMember" runat="server"></asp:TextBox>
2
8291
by: encoad | last post by:
Hi everyone, I'm slowly going mad with Masterpages and the FindControl. After a couple days of figuring out how to use the FindControl command from within a Masterpage, I still can't explain why this code does not function. As you can see if you compile it with 2005, clicking "Button" will achieve the desired result of displaying the contents of the textbox, however the test(); function called from Page_Load does not do anything. ...
11
1888
by: =?Utf-8?B?TWlrZSBDb2xsaW5z?= | last post by:
I am trying to get the text of an item in a GridView, but am doing something wrong. Can someone help me with the correct C# statement I need? Below is my GridView and my attempt to get the control. Thank you. string option = ((TextBox)dgDropDownMenus.Items.FindControl("txtName")).Text; -----------------------DataGrid------------------------------------------- <asp:datagrid id="dgMenus" style="Z-INDEX: 101; LEFT: 0px; POSITION:
5
1813
by: daniel.hedz | last post by:
I am generating a usercontrol dynamically successfully, but when I try to find that usercontrol I get a type mismatch. This is what I am doing: //Loading my usercontrol MyWebApp.Folder.Folder.MyUsercontrol myUC = (MyWebApp.Folder.Folder.MyUsercontrol) LoadControl("~/Folder/Folder/MyUsercontrol.ascx");
14
3194
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
Hi. I have created a UserControl ("MyUC"). I've put a bunch of instances of that control on a Page ("Defaul.aspx"). The control works fine. Now, I want to be able to use "FindControl()" from within my Default.aspx as follows: MyUC C = (MyUC)this.FindControl("SomeID"); When I try to run this, I get error: "The type or namespace name 'MyUC' could not be found (are you missing a
7
5691
by: AAaron123 | last post by:
Me.FindControl("MissionScheduleID"), below returns null. Do you know what I'm doing wrong? Thanks ***In my .aspx file I have: asp:Content ID="Content3" contentplaceholderid="MainMasterLeftDataID" runat="server">
4
2979
by: Hillbilly | last post by:
Maybe this is or isn't some kind of bug but it sure is goofy and remains a mystery that really has me puzzled for two reasons... // goofy syntax functions as expected... Panel finalStepButton = Page.Master.FindControl("CenterPanelContent $ItemBuilderWizard $StepNavigationTemplateContainerID $StepNavFinalStepButton") as Panel;
9
2182
by: AAaron123 | last post by:
I'm this far in determining the correct code to find a textbox I need to set. Me.Master.FindControl("Body1").FindControl("Form2").FindControl("Table2").FindControl("TableRow7").FindControl("TableCellR7C2S2").FindControl("RightCPH").FindControl("div1").FindControl("div2").FindControl("LoginView1") Took me longer than I want to say to produce the above and I'm not there yet.
0
8485
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
8403
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8930
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...
0
8677
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
7446
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...
1
6238
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4227
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
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.