473,762 Members | 8,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing control in nested datalist

I have a nested datalist with a dropdownlist. I need to capture the
selectedvalue of the dropdownlist so I can update a database table. My
question then is...how do I get the value from the nested datalist? Thanks
for any help.
Nov 19 '05 #1
3 2000
You'll need to get the DataListItem in your DataList you want, then use FindControl("Yo urDropDownListI D")
to fetach the control. You'll have to cast the return value to your control's
type.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have a nested datalist with a dropdownlist. I need to capture the
selectedvalue of the dropdownlist so I can update a database table.
My question then is...how do I get the value from the nested datalist?
Thanks for any help.


Nov 19 '05 #2
Thanks for the reply Brock. The nested datalist is populated dynamically
from a database. How then, would I get the DataListItem. Thanks.

"Brock Allen" wrote:
You'll need to get the DataListItem in your DataList you want, then use FindControl("Yo urDropDownListI D")
to fetach the control. You'll have to cast the return value to your control's
type.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have a nested datalist with a dropdownlist. I need to capture the
selectedvalue of the dropdownlist so I can update a database table.
My question then is...how do I get the value from the nested datalist?
Thanks for any help.


Nov 19 '05 #3
You get the DataListItem based upon which ever entry you need. How does the
user tell you? I assume you'll have a button of some sort for each item yes?
In that case handle the DataList's ItemCommand event. The e.Item parameter
is the ListItem that contained the button that was pressed.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Thanks for the reply Brock. The nested datalist is populated
dynamically from a database. How then, would I get the DataListItem.
Thanks.

"Brock Allen" wrote:
You'll need to get the DataListItem in your DataList you want, then
use FindControl("Yo urDropDownListI D") to fetach the control. You'll
have to cast the return value to your control's type.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have a nested datalist with a dropdownlist. I need to capture the
selectedvalue of the dropdownlist so I can update a database table.
My question then is...how do I get the value from the nested
datalist?
Thanks for any help.


Nov 19 '05 #4

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

Similar topics

4
2892
by: Das | last post by:
Hi, I have made an application in ASP.net with C#. The application works fine with localhost. I have uploaded the site. I'm using web user controls in the form. but some of the button do not work when they are clicked. One thing that I have found that they are nested user controls. which do not work. I'm unable to understand what is the problem with that. thanks in advance. Das
1
3185
by: Doug | last post by:
The html below shows DataList "DiscountList" nested within DataList "EventItemList". DiscountList contains a Label control. I'm trying to find the label, using FindControl, during EventList_ItemCreated (below the html), but it's always <undefined value> (null). Everything else works fine. Eventually I need to set the value of the label depending up the Count of the DataView "dvDiscount". For now I'll settle for just finding the damn...
8
2837
by: Nevyn Twyll | last post by:
I have a multi-level datalist setup: DataList1 DataList2 MyGrid I have columns explicitly defined for the grid in the html. Sometimes, On the initial Load() of the Page, I want to add extra columns to the datagrid - for all records. I tried getting a reference to the datagrid like this:
0
1706
by: s.gregory | last post by:
My page layout is like this: Page >DataList (databound using ObjectDataSource1 contained in page) >>Items >>>UserControl >>>>GridView (databound using another ObjectDataSource2 contained in UserControl) So I've basically got a GridView (wrapped in a UserControl), that is nested within a DataList. Representing a fairly simple relational data
1
2199
by: Mike | last post by:
I have a Datalist control on my page that I have binded to a table of available categories. In the Item Template I have a CheckboxList control bound to the products available in each Category. I need to pull out of the page which products the user has selected. I have bound the products to the CheckboxList control in the ItemDataBound event for the Datalist. How can I extract what checkboxes have been selected inside the Datalist?
2
1815
by: R.A.M. | last post by:
Hello, I need your help in a problem of putting and accessing asp control in FooterTemplate of asp:DataList. I created a DataList: <asp:DataList ID="BooksList" runat="server" OnEditCommand="BooksiList_Edit" OnUpdateCommand="BooksiList_Update" OnDeleteCommand="BooksList_Delete"> .... <FooterTemplate>
3
8265
by: mroffey | last post by:
Hi everyone, I've been having this problem and I've searched high and low, but I can't seem to find the answer to what is probably a very simple solution. In a nutshell, I have a nested datalist, Parent and Child. In the child datalist, I need to get 1 of the values from the parent datalist. I've included the dataaccess code below, only for completeness.
1
25007
by: Salim | last post by:
Hi, I'm trying to get UniqueID of a linkbutton. I have 2 web user controls. And a master page. In fisrst web user control there is a datalist. In datalist ItemCreated event, I try to find a linkbutton control which is in the second web user control and in another datalist.
8
10838
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList steps successfully with the following code... Control myContainer = (Control)Wizard1.FindControl("SideBarContainer"); DataList mySideBarList = (DataList)myContainer.FindControl("SideBarList");
0
9554
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
10137
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
9989
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
9812
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
8814
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
7360
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
5268
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...
1
3914
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.