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

Creating a Function to Find and Return CheckBox Status

Rob

Hi,

I am creating a DataList with many CheckBoxes. When I click the Update
button the UpdateCommand fires and my code looks at each CheckBox and
determines if it is checked or not. The way I have it now seems a bit
tedious. I thought it would make more sense to pass the CheckBox to a
Function and return whether or not it is checked.

The problem I am having is I understand (barely) how to get the
control off the DataList because I can pass the e As
DataListCommandEventArgs to FindControl. But if I make my own function, I
don't know how to pass that same argument to the FindControl. If I knew
that, then I could make my own function that looks for the CheckBox and
returns its Checked status.

So my question is, how do I pass the DataListCommandEventArgs to a
Function that is not one of the default Events? Also, any
resources/information I could read would be helpful - I am a newbie.

Thanks for your help.
Nov 18 '05 #1
1 1475
you can have a parameter to the function as is DataListCommandEventArgs e
YourFunction(DataListCommandEventArgs args) and call this. passing what is
actually required would be better.

Av.

"Rob" <gu*******@hotmail.com> wrote in message
news:10*************@corp.supernews.com...

Hi,

I am creating a DataList with many CheckBoxes. When I click the
Update
button the UpdateCommand fires and my code looks at each CheckBox and
determines if it is checked or not. The way I have it now seems a bit
tedious. I thought it would make more sense to pass the CheckBox to a
Function and return whether or not it is checked.

The problem I am having is I understand (barely) how to get the
control off the DataList because I can pass the e As
DataListCommandEventArgs to FindControl. But if I make my own function, I
don't know how to pass that same argument to the FindControl. If I knew
that, then I could make my own function that looks for the CheckBox and
returns its Checked status.

So my question is, how do I pass the DataListCommandEventArgs to a
Function that is not one of the default Events? Also, any
resources/information I could read would be helpful - I am a newbie.

Thanks for your help.

Nov 18 '05 #2

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

Similar topics

16
by: chudson007 | last post by:
I have a table, TableA with amongst other fields, a field for Qty. Qty can range from 0 to 100. How do I count the number of rows with a qty between 1 and 10, 11 and 20, 21 and 30, and so on using...
2
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display...
12
by: enak | last post by:
I have found some code that shows how to convert an html form to Word. The message said to simply put the following in the Page_load: Response.ContentType = "application/ms-word"...
3
by: Moe Sizlak | last post by:
Hi, Can I check a checkbox by default based on the value returned from a database? for example if the value (dr("frm7value")) returned from a db field is "YES" how can I check the checkbox by...
7
by: RHPT | last post by:
I have a checkbox that I dynamically check (via JavaScript) when the user initiates an action on the page. I want to prevent the user from unchecking the box if that action has been initiated and...
2
by: somaskarthic | last post by:
Hi In my php code , i dynamically created table rows on button click event. Each row contain 3 selectboxes, 7 checkboxes . On each click of these elements i need to submit the form and save the...
8
by: Sid | last post by:
I hope someone could help me with this. I am trying to setup a criteria to decide when to allow/not allow user to click on the check box. logically it looks simple but I am not able to...
5
eragon
by: eragon | last post by:
I wrote this function to create a new file when the user posts in my forums, and its not creating a new file, can you help me? this script is not copyrighted as the last one. function...
2
by: livmacca | last post by:
Hi, I am trying to create a web page whereby I first read data from Oracle Database and display the records out on the data grid. The data displayed is in order of one attribute say 'A' meaning...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.