473,804 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting handle on contol programatically

Hi,

I'm sure there's a really easy way of doing this, but I haven't found it
yet.

I have a bunch of asp:hyperlinks. I have their IDs stored in a
database. I want to be able to pull a record from the database and get
a handle on the control with that ID.

I thought FindControl might work something like this:

FindControl(IDv alueFromDatabas e).CssClass = blah

But that doesn't work. How should I be using findControl? Or how about
another way of doing it?

Thanks
Nov 19 '05 #1
1 1042
That's how it works. I can only guess you aren't using FindControl on the
control that directly contains the hyperlinks (e.g. LinkPanel.FindC ontrol).
FindControl only finds direct children of the current control (which would
be the page in that instance).

"Sosh123" <so**@so9sh.com > wrote in message
news:eE******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

I'm sure there's a really easy way of doing this, but I haven't found it
yet.

I have a bunch of asp:hyperlinks. I have their IDs stored in a
database. I want to be able to pull a record from the database and get
a handle on the control with that ID.

I thought FindControl might work something like this:

FindControl(IDv alueFromDatabas e).CssClass = blah

But that doesn't work. How should I be using findControl? Or how about
another way of doing it?

Thanks

Nov 19 '05 #2

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

Similar topics

17
4693
by: John Hunter | last post by:
I have a largish data set (1000 observations x 100 floating point variables), and some of the of the data are missing. I want to try a variety of clustering, neural network, etc, algorithms on the data, and to keep life simple I want to reduce the dimensions of the matrix so that I have no missing values, since not all the algorithms are able to handle them and there is sufficient redundancy in the variables that I can afford to lose...
15
3383
by: Christian Tismer | last post by:
Dear friends. During a conversation with good friends and newly acquired Pythonista, we were discussing Python, what it is in essence, and what it is giving to us. The people were Dinu Gherman, Giorgio Giacomazzi, a promizing newcomer in the Python noosphere, and myself. We were discussing how to advertize for Python, and Dinu
3
9031
by: Daniel H. | last post by:
Hi! When I create a new form programatically, I can save its handle in a collection of some type Later, I need to find that form based on a handle I saved and call one of its functions. The newly create form can be a child of an MDI form but it very well may not be, so I can not use MDIChildren I am wandering how it can be done in C#, please Thank you in advance Dany
4
1520
by: Joo Park | last post by:
Hello, I'm trying to add a TextBox to a web page dynamically. However, the compiler is complaining that it needs to be place in a form. How do I get a reference to a form object so that i can do the following? Form.Controls.Add(textbox);
0
2354
by: bob | last post by:
I'm using the DataGridView control, with EditMode set to "edit programatically" and SelectionMode set to "FullRowSelect" (or something like that). My program allows the User to go into edit mode by double-clicking a row, or pressing F2, or selecting a menu item (Row/Edit). When that happens, I turn SelectionMode into "CellSelect" (or something like that) -- otherwise, the User can't see what he is editing too well. Ok, now the User edits...
0
920
by: mark16 | last post by:
Hey guys, Ive got a handle on a windows application using c#, now ive figured out how to get simple contol of it by using the SendKey.send(); function which sends basic keyboard outputs. So far ive been sending tab to pick options such as text box or button. Does anybody know to to specifically tell the application what button to control without tabing to it? If ye get me. Regards mark
2
3139
by: jvdub22 | last post by:
I am currently using a VB 6 MS Data Grid Control bound to an SQL express data base. My grid has 20 visible rows when I load my form, when I scroll down and select a row higher than 20 the grid refers back to the corresponding row in the original 1-20. For example I can select any row less than 20 just fine, but if I select row 22 the grid will move me to row 2 or if select row 58 the grid moves me to row 18. I've read that this behavior is...
33
11870
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon (NT_AUTHORITY\SYSTEM). I understand that when the service starts, no user may be logged in, but that's ok, as the app I am monitoring can only be run by a logged in user. Do I need to use WMI to get the user context of Explorer.exe or is there a...
5
2580
by: jediknight | last post by:
Is it possible to programmatically stop multiple browsers from getting the same session state? The problem I have is that whenever I open a new browse using File- I would like to stop this from happening and redirect to the homepage. Thanks in advance!
0
9595
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
10600
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
10352
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10097
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
9175
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
6867
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
5535
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
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
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.