473,796 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CheckBoxBoxList outside a DataList!!

I have this checkboxlist out side a Datalist below:-

<asp:checkboxli st id="chkList" AutoPostBack="T rue" Runat="server"
DataValueField= "ProductFeature ID"
DataTextField=" Feature"
OnSelectedIndex Changed="Check_ Clicked"></asp:checkboxlis t></

And the event that fires after when the checkBoxList is clicked
-------------------------------------------------------
Sub Check_Clicked(B yVal sender As Object, ByVal e As EventArgs) Handles
chkList.Selecte dIndexChanged
'print.Text = "Selected Item(s):<br><br >"
Dim i As Integer
For i = 0 To chkList.Items.C ount - 1
If chkList.Items(i ).Selected Then
P &= "_" & chkList.Items(i ).Value
'Tested it here to print it to the screen
print.Text = P & "<br>"
End If
Next

End Sub
This is my link below in the DataList( What i want to get is the value
selected below which is ok but after selecting a checkbox i want to
append only the checbox value the user has selected but i noticed that
after the Check_Clicked fires i can't get the right values appended to
the link.

Any help please?

------------------------------------------------
<a href='AddToCart .aspx?productID =<%#
DataBinder.Eval (Container.Data Item, "ProductID" ) & "&Features= " & P &
","
%>'>Add To Cart</a>


*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
2 1009
I read somewhere that with the CheckBoxList, it's not possible to figure out
which box was actually clicked. Maybe instead of binding your data to a
CheckBoxList, you could bind to a datalist of checkboxes? I could be
wrong...

"Patrick Olurotimi Ige" <na********@hot mail.com> wrote in message
news:uS******** ******@TK2MSFTN GP14.phx.gbl...
I have this checkboxlist out side a Datalist below:-

<asp:checkboxli st id="chkList" AutoPostBack="T rue" Runat="server"
DataValueField= "ProductFeature ID"
DataTextField=" Feature"
OnSelectedIndex Changed="Check_ Clicked"></asp:checkboxlis t></

And the event that fires after when the checkBoxList is clicked
-------------------------------------------------------
Sub Check_Clicked(B yVal sender As Object, ByVal e As EventArgs) Handles
chkList.Selecte dIndexChanged
'print.Text = "Selected Item(s):<br><br >"
Dim i As Integer
For i = 0 To chkList.Items.C ount - 1
If chkList.Items(i ).Selected Then
P &= "_" & chkList.Items(i ).Value
'Tested it here to print it to the screen
print.Text = P & "<br>"
End If
Next

End Sub
This is my link below in the DataList( What i want to get is the value
selected below which is ok but after selecting a checkbox i want to
append only the checbox value the user has selected but i noticed that
after the Check_Clicked fires i can't get the right values appended to
the link.

Any help please?

------------------------------------------------
<a href='AddToCart .aspx?productID =<%#
DataBinder.Eval (Container.Data Item, "ProductID" ) & "&Features= " & P &
","
%>'>Add To Cart</a>


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

Nov 19 '05 #2
thx kim for the reply.
i have been looking for a solution but not found any concrete ones.maybe
you are right.
And do you have the link where you read it from?
And when you say i could bind to a datalist of checkboxes how can i do
that and what do you mean?
Becos i also have a scenario were i binded the ChecKBoxList in a
Datalist and i did that using OnItemDataBound .
But still hasn't figured out which box was acually clicked so that i
can retrieve the values/Selected Item.
If you have more info please post it
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #3

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

Similar topics

4
8305
by: jenn | last post by:
Hi Anyone knows how to access to a value of a row in a datalist. Something like this in datagrid Dim str = MyDataGrid.Cell(0).tex I would like something like this Dim str = DataBinder.Eval(MyDatalist.Items(count).DataItem, "customerId") but it doesn't work.
8
653
by: MattB | last post by:
I think I'm close to making this work, but so far it does not. I have a datalist (id = "dlVFields") on a web form that has an item template with a textbox in it. The textbox id = "txtVerify". When the form is submitted via a button click (button is outside datalist) I loop through the datalist's DataListItem collection to retrieve any values entered into the textboxes. My problem is that I'm not getting anything back from the textboxes...
1
3343
by: Glenn Owens | last post by:
Here's the scenario: I have a DataList populated from a datatable sitting inside a fieldset. Each element (row) in the Datalist has the following child controls: asp:checkbox, asp:image, asp:labels. Within the <form>, but outside the fieldset, containing the datatlist, I have a usercontrol (used to collect search criteria) and some asp:button controls (used to initiate actions - ie. retrieve db data, reset user control fields,...
1
1321
by: Luis Esteban Valencia | last post by:
Is it possible to enter the EditItemTemplate of a Datalist from outside of the DataList? For example: I have a Webform with a datagrid of data displaying only 3 fields and a hyperlink to edit for each entry. When the edit button is clicked, I would like to take the user to the EditItemTemplate of a DataList in another Webform, which contains all the fields that they can edit. Is this possible?
5
2055
by: Petr SIMUNEK | last post by:
Is there a way to render something before the DATALIST encapsulation table gets rendered ? So that I could have Label before actual table that is rendered by DATALIST... <h1>Some Label</h1> <TABLE ID='DataList' width='100%'> *** inside datalist objects rendered *** </TABLE> Thanx to all...
0
1668
by: fig000 | last post by:
Hi, I have a datalist with bound data from a database. If I wanted to access one of the fields I would normally use the itemdatabound event to access that field on each row. However in this case I want to be able to click one button (not a button on each row of the datalist) and have the code run through each row of the datalist and store the values of the database fields used in the datalist to a table.
1
2174
by: rn5a | last post by:
A ASPX page has a DataList control with a few Labels. This page also has a CheckBox which resides OUTSIDE the DataList. By default, this CheckBox is checked. If the CheckBox is checked, then the Labels existing in the DataList should be visible but if the CheckBox is unchecked by the user, the Labels inside the DataList should be made invisible. How do I do this? Note that the AutoPostBack property of the CheckBox has been set to
4
2183
by: sridhar21 | last post by:
hi to all I am sridhar My doubt is I got a panel and a datalist and a button inside the datalist in my webform
0
857
by: sridhar21 | last post by:
hi to all i am having datalist inside updatepanel and a panel(default VISIBLE FALSE) outside updatepanel and i am having linkbutton as item templete in datalist, if i click the linkbutton, change visible property as TRUE of the panel (which was outside the updatepanel) thanks
0
9673
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
9524
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
10449
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...
1
10168
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
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...
1
7546
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
6785
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();...
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
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.