473,386 Members | 1,873 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,386 software developers and data experts.

How to refer to dynamically created objects?

Hi

I want to make a reference to a dynamically created asp:checkbox:
string strcheckboxname ="chkbox1";
((CheckBox)Table1.Rows[i].FindControl(strcheckboxname)).Visible = true;

Unfortunately this does not work? what would be the right way of doing
it?

ch Beffmans

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
3 1051
Try

Rows[i].Cells[j].FindControl ...

Eliyahu

<Beffmans> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi

I want to make a reference to a dynamically created asp:checkbox:
string strcheckboxname ="chkbox1";
((CheckBox)Table1.Rows[i].FindControl(strcheckboxname)).Visible = true;

Unfortunately this does not work? what would be the right way of doing
it?

ch Beffmans

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #2

yes but then you still would be needing the controlname..
and I can't use a variable to do this?

B
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #3


nevermind got it!

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #4

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

Similar topics

16
by: sirsean | last post by:
Hi all. I'm trying to dynamically build menus and objects after my page loads. Data is stored in an XML file and is parsed at runtime into Javascript objects. At the moment, I'm working on creating...
1
by: Epson Barnett | last post by:
Hi, I'm new to C# and I'd like to be able to reference a field of an object using a variable instead of literal text. In the PHP scripting language, you can create a variable: $var = "name";...
4
by: Ray | last post by:
I want to dynamically load DLLs (created from VB) and instantiate a class with a particular name, like "ProcessClass". I am able to load the DLL and confirm there is a class by that name BUT I...
2
by: Colin McGuigan | last post by:
This is a translation of an ASP page to ASP.Net. First, the background: The goal is to have a grid of different settings for the application -- think something along the lines of the Property...
12
by: vbnewbie | last post by:
I am having problems accessing properties of dynamically generated objects in VB2005. Can someone please help? In a nutshell: My app creates an equal number of checkboxes and labels that share the...
10
by: Jess | last post by:
Hello, I have a program that stores dynamically created objects into a vector. #include<iostream> #include<vector> using namespace std;
2
by: Dwight Johnson | last post by:
I am building a website in VS2005. I basically have one page, default.aspx, which contains placeholder objects into which I add various controls that are dynamically created. I have a dropdownlist...
1
by: krishna81m | last post by:
I am unable to create a list of objects dynamically. I run a SQL query on the database and populate objects of types that I also know aprior. I read the query as a string, run it on the database and...
29
by: Quarco | last post by:
This one is driving me nuts.... var tbl = document.createElement("table"); var tbody = document.createElement("tbody"); for(var i=0; i<10; i++) { var row =...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.