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

Dynamically created control problem

I have created a dropdown ,which is inside a panel and the panel is
inside a place holder . the panel and the dropdown is created
dynamically. I do have a button when the button is clicked i am trying
to read the values from the dropdown.but the problem i am facing is
that i am not getting the id of the dropdown .Please advice me how to
get the id of the dropdown .

Jun 19 '07 #1
5 1483
Hi

Do you eed to read values at the server?
Can you save a reference to your DropDown when you create it in the private
field of you page? You can access your drop-down control directly in the
event handler in this case.
Moreover, if it is possible i would recommend assigning ID to dynamically
created drop-down by yourself, if it is possible

-yuriy
I have created a dropdown ,which is inside a panel and the panel is
inside a place holder . the panel and the dropdown is created
dynamically. I do have a button when the button is clicked i am trying
to read the values from the dropdown.but the problem i am facing is
that i am not getting the id of the dropdown .Please advice me how to
get the id of the dropdown .

Jun 19 '07 #2
Hi Yuriy ,

Thanks for the advice. I have assigned ID to dynamically created
dropdown. But when i try to go to the place holder and try to get the
values using a loop i can not do so as i am not getting the id of the
dropdown there.

Thanks,
Arnab
Yuriy Solodkyy wrote:
Hi

Do you eed to read values at the server?
Can you save a reference to your DropDown when you create it in the private
field of you page? You can access your drop-down control directly in the
event handler in this case.
Moreover, if it is possible i would recommend assigning ID to dynamically
created drop-down by yourself, if it is possible

-yuriy
I have created a dropdown ,which is inside a panel and the panel is
inside a place holder . the panel and the dropdown is created
dynamically. I do have a button when the button is clicked i am trying
to read the values from the dropdown.but the problem i am facing is
that i am not getting the id of the dropdown .Please advice me how to
get the id of the dropdown .
Jun 19 '07 #3
You need to re-create dynamically created controls on every postback
preferably in the Page_Init event.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
<ar*****@gmail.comwrote in message
news:11**********************@c77g2000hse.googlegr oups.com...
>I have created a dropdown ,which is inside a panel and the panel is
inside a place holder . the panel and the dropdown is created
dynamically. I do have a button when the button is clicked i am trying
to read the values from the dropdown.but the problem i am facing is
that i am not getting the id of the dropdown .Please advice me how to
get the id of the dropdown .

Jun 19 '07 #4
What time in the page lifecycle do you create your dropd-won?
Hi Yuriy ,

Thanks for the advice. I have assigned ID to dynamically created
dropdown. But when i try to go to the place holder and try to get the
values using a loop i can not do so as i am not getting the id of the
dropdown there.

Thanks,
Arnab
Yuriy Solodkyy wrote:
>Hi

Do you eed to read values at the server?
Can you save a reference to your DropDown when you create it in the
private
field of you page? You can access your drop-down control directly in
the
event handler in this case.
Moreover, if it is possible i would recommend assigning ID to
dynamically
created drop-down by yourself, if it is possible
-yuriy
>>I have created a dropdown ,which is inside a panel and the panel is
inside a place holder . the panel and the dropdown is created
dynamically. I do have a button when the button is clicked i am
trying to read the values from the dropdown.but the problem i am
facing is that i am not getting the id of the dropdown .Please
advice me how to get the id of the dropdown .

Jun 19 '07 #5
Hi ,

My problem has been solved. Actually I have created the dropdown in a
class file,as i have removed the class file now i can get the id of
the dropdown.

Thanks,
Arnab

Yuriy Solodkyy wrote:
What time in the page lifecycle do you create your dropd-won?
Hi Yuriy ,

Thanks for the advice. I have assigned ID to dynamically created
dropdown. But when i try to go to the place holder and try to get the
values using a loop i can not do so as i am not getting the id of the
dropdown there.

Thanks,
Arnab
Yuriy Solodkyy wrote:
Hi

Do you eed to read values at the server?
Can you save a reference to your DropDown when you create it in the
private
field of you page? You can access your drop-down control directly in
the
event handler in this case.
Moreover, if it is possible i would recommend assigning ID to
dynamically
created drop-down by yourself, if it is possible
-yuriy

I have created a dropdown ,which is inside a panel and the panel is
inside a place holder . the panel and the dropdown is created
dynamically. I do have a button when the button is clicked i am
trying to read the values from the dropdown.but the problem i am
facing is that i am not getting the id of the dropdown .Please
advice me how to get the id of the dropdown .
Jun 20 '07 #6

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

Similar topics

1
by: Karl Seguin | last post by:
i have a dynamically created user control which contains a non-dynamically created ASP.Net button. When the button is clicked, the event is not fired. I know that the control must be created on...
0
by: John Crowley | last post by:
I'm having an odd problem with viewstate and a dynamically created control inside a repeater template. Basically, I have a repeater setup like this in the aspx:
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
2
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web...
2
by: djc | last post by:
On the page_load event I am querying a database and binding data to some text boxes, list boxes, and a repeater control. When the page loads it uses the value of one of the database fields (status)...
2
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to...
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...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...

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.