We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to retrieve value of label from datalist

Thread ID:

Created:

Updated:

Platform:

Replies:

33841 Aug 26,2005 08:34 PM UTC Oct 12,2005 02:23 PM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: FAQ
ceema
Asked On August 26, 2005 08:34 PM UTC

Dear all, I have a datalist with one label and one checkbox in it. I want to check(once the button is clicked) whether the checkbox is checked and if it''s checked print the label value. The code of datalist is as follows.. ''> '' Visible="False"> Thanks Meera

Mark S.
Replied On October 12, 2005 02:23 PM UTC

If you have this running as a server control, you can declare a checkbox or label and then cycle through them all in a loop and if they are checked then take some action: Dim CurrentCheckBox As CheckBox For i = 0 To datalist.Items.Count - 1 CurrentCheckBox = datalist.Item(i).FindControl("checkbox") If CurrentCheckBox.Checked = False Then ''do something here End if Loop where checkbox is the id for the control. Works the same for Label, just declare a label Dim CurrentLabel as Label CurrentLabel=datalist.Item(i).FindControl("label") Hope this helps. Remove the spams to email me. Mark

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;