passing values through checkbox

how do i  pass a valuethrough a checkbox
Codeaddict7423Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Codeaddict7423Author Commented:
passing values through checkboxes
0
Om PrakashCommented:
Where ho you want to pass values through checkbox?
On click of checkbox, do you want to enable javascript or do some processing  on server?
0
felipe_schauenburgCommented:
Please explain better your question
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Codeaddict7423Author Commented:
thank you. i'm getting a better definition of the goal for the checkboxes now and i'll ask again later.
0
Codeaddict7423Author Commented:
hello,
i have a better understanding now.  how do i pass a value from a checkbox when the user checks a checkbox?
0
alpiresCommented:
<input type="checkbox" name="mycb" value="myvalue"

if checked variable "mycb" will have value "myvalue"

is it u want?
0
alpiresCommented:
<input type="checkbox" name="mycb" value="myvalue"> **
0
Codeaddict7423Author Commented:
i tried the input idea and it did not pass the value. i have this
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="false" Text="April 23, 2010 Test"  />
how do i pass the value "April 23, 2010" directly from this check box so that the checkbox is identified wome  way other than "checkbox1" and has a value of a text string?
0
felipe_schauenburgCommented:
The best way is to put code in the checked changed event.
Then you can verify the checked property, for example:

private void myCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            if(myCheckBox.Checked)
                  //do something
        }
0
Codeaddict7423Author Commented:
great, i'm using vb.net, can you please provide sample code to make the asp:checkbox control have an id other than checkbox1 and pass a value of a text string?
0
rajapandian_81Commented:
To get Checkbox's text in code behind file use
string strChkBoxText = CheckBox1.Text;

To get Checkbox's text in javascript refer
http://blog-dotnetsp.blogspot.com/2010/01/get-checkbox-text-and-checked-property.html
0
Codeaddict7423Author Commented:
rajapandian_81:
Thank you. can you please help with the javascript code to do this?
0
rajapandian_81Commented:
Codeaddict7423,
Whenever you click the checkbox, javascript will alert the checkbox's text. Is that you are looking for?
function checkboxClick(obj) 
    { 
        var lbl = obj.nextSibling; 
        while(lbl.nodeName.toLowerCase()!='label')  
            lbl=lbl.nextSibling; 
      
        alert(lbl.innerHTML);        
    } 


<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="false" Text="April 23, 2010 Test" onclick="checkboxClick(this);"  />

Open in new window

0
Codeaddict7423Author Commented:
rajapandian_81:
Thank you, i tried your suggestion and the return result is "CheckBox1" = True.  How can assign an ID to CheckBox1 or rename it to something like "Date of Workshop" and have a text string attached to it so that it returns a value like "April 23" ? i'm really pressured to fix this... please help.
0
rajapandian_81Commented:
I can't understand your question. Please clarify your needs.
0
Codeaddict7423Author Commented:
rajapandian_81:
Thanks for replying.  I'm really under pressure here. Im using VB.NET in a user control. in that user control there is a checkbox next to the description of an event scheduled for April 23, 2010.
i have a asp: checkbox "<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="false" Text="April 23, 2010 Test" onclick="checkboxClick(this);"  /> "

I'm trying to get this checkbox , when checked, to return a value something other thann "checkbox1" and a text string of "April 23, 2010"
i'm open to using javascript or vb.net code...any sample code that works is great....
Please, pleae help
0
rajapandian_81Commented:
So you need some string like 'Date of Workshop'  and the text of checkbox when it is checked.
Try below javascript. I will post vb.net code also.

function checkboxClick(obj) 
    {                 
        if (obj.checked)
        {
            var lbl = obj.nextSibling; 
            while(lbl.nodeName.toLowerCase()!='label')  
                lbl=lbl.nextSibling;   
            alert('Date of Workshop ' + lbl.innerHTML);      
        }        
    } 

<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="false" Text="April 23, 2010" onclick="checkboxClick(this);"  />

Open in new window

0
Codeaddict7423Author Commented:
rajapandian_81:
Thank yoiu. will this javascript code pass the value of the checkbox? I'm trying to get the checkbox name (something like "Date of Workshop") to pass a value or a string like "April 23, 2010" directly maby this van be passed on to a hidden field?

Please help...
0
nomooseCommented:
Hey Jason,
Did you come across this in your research? http://forums.asp.net/t/769696.aspx  Seems like this guy figured it out.

Hope this helps,
 Elliot
0
Codeaddict7423Author Commented:
nomoose:
i'm sorry i did not see a solution to my question.
this is what i'm trying to do:
 I'm using VB.NET in a user control. in that user control there is a checkbox next to the description of an event scheduled for April 23, 2010.
i have a asp: checkbox "<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="false" Text="April 23, 2010 Test" onclick="checkboxClick(this);"  /> "

I'm trying to get this checkbox , when checked, to return a value something other thann "checkbox1" and a text string of "April 23, 2010"
i'm open to using javascript or vb.net code...any sample code that works is great....
Please, help
0
rajapandian_81Commented:
You can store the checkbox's id and text in hidden field and use it in server side.

function checkboxClick(obj) 
    {                 
        if (obj.checked)
        {
            var lbl = obj.nextSibling; 
            while(lbl.nodeName.toLowerCase()!='label')  
                lbl=lbl.nextSibling;               
            document.getElementById('<%= hdn.ClientID %>').value = obj.id + ' ' + lbl.innerHTML;            
        }        
    } 


<asp:CheckBox ID="Date_of_Workshop" runat="server" AutoPostBack="false" Text="April 23, 2010" onclick="checkboxClick(this);"  /> 
<input type="hidden" runat="server" id="hdn" />

Open in new window

0
Codeaddict7423Author Commented:
rajapandian_81:
thank you for the reply
when i implemented your solution, i got this:
-----------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30451: Name 'hdn' is not declared.

Source Error:

Line 89:             while(lbl.nodeName.toLowerCase()!='label')  
Line 90:                 lbl=lbl.nextSibling;                
Line 91:             document.getElementById('<%= hdn.ClientID %>').value = obj.id + ' ' + lbl.innerHTML;            
Line 92:         }        
Line 93:     }
 --------------

how do i declare "hdn"?
thanks,
0
rajapandian_81Commented:
In Comment #29217725 I added one hidden control like

<input type="hidden" runat="server" id="hdn" />
0
Codeaddict7423Author Commented:
rajapandian_81:
Thanks for the quick reply. Yes, i saw that and included it in my code. i have the Javascript as:
<script type="text/javascript" language="javascript">

    function checkboxClick(obj)  
    {                  
        if (obj.checked)
        {
            var lbl = obj.nextSibling;  
            while(lbl.nodeName.toLowerCase()!='label')  
                lbl=lbl.nextSibling;                
            document.getElementById('<%= hdn.ClientID %>').value = obj.id + ' ' + lbl.innerHTML;            
        }        
    }  
</script>

and the checkbox code as follows:

<asp:CheckBox ID="Date_of_Workshop" runat="server" AutoPostBack="false" Text="April 23, 2010" onclick="checkboxClick(this);"  />  
<input type="hidden" runat="server" id="hdn" />

what did i do wrong?
0
rajapandian_81Commented:
Which version of visual studio you are using?

Are you getting the same error?
0
Codeaddict7423Author Commented:
rajapandian_81:
I'm using Visual Studio 2005
I'm trying to declare "hdn" in the Javascript so the script would run but am not havingany luck.

I get this error at runtime:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30451: Name 'hdn' is not declared.

Source Error:

 

Line 51:             while(lbl.nodeName.toLowerCase()!='label')  
Line 52:                 lbl=lbl.nextSibling;                
Line 53:             document.getElementById('<%= hdn.ClientID %>').value = obj.id + ' ' + lbl.innerHTML;            
Line 54:         }        
Line 55:     }  
 
0
rajapandian_81Commented:
Delete the line
<input type="hidden" runat="server" id="hdn" />

and add HiddenField from ToolBox. Then change the id to hdn
0
Codeaddict7423Author Commented:
rajapandian_81:
i'm still getting the same error;

this is what i put in:

<asp:CheckBox ID="Date_of_Workshop" runat="server" AutoPostBack="false" Text="April 23, 2010" onclick="checkboxClick(this);"  />  

    <input id="hdn" type="hidden" runat="server" />
-----------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30451: Name 'hdn' is not declared.

Source Error:

 

Line 53:             while(lbl.nodeName.toLowerCase()!='label')  
Line 54:                 lbl=lbl.nextSibling;                
Line 55:             document.getElementById('<%= hdn.ClientID %>').value = obj.id + ' ' + lbl.innerHTML;            
Line 56:         }        
Line 57:     }  
 
0
Codeaddict7423Author Commented:
rajapandian_81:

The error seems to be coming from the Javascript area and i was trying to declare "hdn" as var hdn=" ";
0
Codeaddict7423Author Commented:
rajapandian_81:
The error is specific to this line:
Line 55:             document.getElementById('<%= hdn.ClientID %>').value = obj.id + ' ' + lbl.innerHTML;

please please help!
0
rajapandian_81Commented:
Codeaddict7423:

As mentioned in Comment #29221471, remove the line
<input type="hidden" runat="server" id="hdn" />

Then try to add HiddenField control from ToolBox. Then change the id to hdn
0
Codeaddict7423Author Commented:
rajapandian_81:
Thanks for the quck reply, i did as you suggested, deleted the <input type hidden field and then readded a new field as follows:
<asp:CheckBox ID="Date_of_Workshop" runat="server" AutoPostBack="false" Text="April 23, 2010" onclick="checkboxClick(this);"  />  

    <input id="hdn" type="hidden" runat="server" />

however, i 'm still getting this:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30451: Name 'hdn' is not declared.

Source Error:

 

Line 53:             while(lbl.nodeName.toLowerCase()!='label')  
Line 54:                 lbl=lbl.nextSibling;                
Line 55:             document.getElementById('<%= hdn.ClientID %>').value = obj.id + ' ' + lbl.innerHTML;            
Line 56:         }        
Line 57:    
 
i'm desperate for a solution...please help!
0
rajapandian_81Commented:
I think you misunderstood.

I told to add the control from toolbox. You can drag and drop the control from toolbox. Refer below screenshot.

ToolBox.PNG
0
rajapandian_81Commented:
So that new control will be added like
<asp:HiddenField ID="HiddenField1" runat="server" />
0
rajapandian_81Commented:
So final code will be

function checkboxClick(obj)  
    {                  
        if (obj.checked) 
        { 
            var lbl = obj.nextSibling;  
            while(lbl.nodeName.toLowerCase()!='label')   
                lbl=lbl.nextSibling;                
            document.getElementById('<%= HiddenField1.ClientID %>').value = obj.id + ' ' + lbl.innerHTML;             
        }         
    }  
 
 
<asp:CheckBox ID="Date_of_Workshop" runat="server" AutoPostBack="false" Text="April 23, 2010" onclick="checkboxClick(this);"  />  
<asp:HiddenField ID="HiddenField1" runat="server" />

Open in new window

0
rajapandian_81Commented:
vb.net code:
Set the AutoPostBack as true for checkbox. Then CheckedChanged code will be

Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If (CheckBox1.Checked) Then
            SomeFunction(CheckBox1.ID + " " + CheckBox1.Text)
        End If
    End Sub

    Sub SomeFunction(ByVal strText As String)
    //Here write steps you needed
    End Sub

Open in new window

0
Codeaddict7423Author Commented:
rajapandian_81:
Thank you for your s uggestion.
Attached, please see a combined screenshot of what i see on my screen.
The "Handles CheckBox1.CheckedChanged" is giving me an error indication in Visual Studio in VB.NET

Please help
checkboxes-01.jpg
0
rajapandian_81Commented:
What error it shows?
Its working fine for me.
0
Codeaddict7423Author Commented:
rajapandian_81:

thanks for the quick reply.  in visual Studio, the sub called:

Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)  Handles CheckBox1.CheckedChanged

the line that starts wtih : Handles CheckBox1.CheckedChanged
is displayed with a squigly blue line under the word "CheckBox1" and throws an error on run

0
rajapandian_81Commented:
Is your both screenshot taken from user control page?
0
Codeaddict7423Author Commented:
rajapandian_81:
yes, absolutely from the user control screen
0
rajapandian_81Commented:
In top can you see CheckBox1 and CheckedChanged as shown in image below
CheckBox.PNG
0
Codeaddict7423Author Commented:
I just changed the dropdown controls to "checkbox1" and "checkedchanged"  appears on the other control. i still get the wavy line, how do i change  that?
0
rajapandian_81Commented:
Its working fine for me.
I am not able to figure out the problem in your application.
0
rajapandian_81Commented:
Can you create a sample application to reproduce error and attach here as a zip file.
0
Codeaddict7423Author Commented:
rajapandian_81:
thank yoiu for your help and time. maybe if i step back and explain what i'm being asked to do you can see.
I have a user control with an asp:checkbox next to a description of a workshop. i'm being asked to program the checkbox so that when a user checks the checkbox, a field (perahps a hidden field) gets populated wtih a string like "April 23, 2010" and returns that string value along with a checkbox name of something like "Workshop One"  I'm being told this is a simple program and i'm banging my head against the wall.

If you and your colleagues can discuss this and help me with a solution, you'd save my day and more...
Thanks,
0
rajapandian_81Commented:
Codeaddict7423:
I am not able to attach application, so I give the code here.

Code for Default.aspx
----------------------------------
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register src="WebUserControl.ascx" tagname="UserControl2" tagprefix="uc1" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>    
    <uc1:UserControl2 ID="UserControl21" runat="server" />
    </div>
    </form>
</body>
</html>


Code for usercontrol ( WebUserControl.ascx)
---------------------------------------------------------------
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="WebUserControl.ascx.vb" Inherits="WebUserControl" %>
<asp:CheckBox ID="Date_of_Workshop" runat="server" AutoPostBack="true" Text="April 23, 2010" OnCheckedChanged="Date_of_Workshop_CheckedChanged" />


Code for WebUserControl.ascx.vb
------------------------------------------------
Partial Class WebUserControl
    Inherits System.Web.UI.UserControl
    Protected Sub Date_of_Workshop_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Date_of_Workshop.CheckedChanged
        If (Date_of_Workshop.Checked) Then
            SomeFunction(Date_of_Workshop.ID + " " + Date_of_Workshop.Text)
        End If
    End Sub

    Sub SomeFunction(ByVal strText As String)

    End Sub
End Class
0
Codeaddict7423Author Commented:
rajapandian_81:
Sir,
Below, please find a code that seems to function but i'd like your opinion.
vbcode:
<script runat="server">
 
    Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim Workshop_One_Date As CheckBox = CType(RSVPForm1.FindControl("Workshop_One_Date"), CheckBox)
        Dim Date_of_First_Workshop As TextBox = CType(RSVPForm1.FindControl("Date_of_First_Workshop"), TextBox)
     
       
       
        Date_of_First_Workshop.Visible = "false"
       
       
        If Workshop_One_Date.Checked = True Then
            Date_of_First_Workshop.Text = "April 23, 2010"
            Date_of_First_Workshop.Visible = "false"
         
        Else
            Date_of_First_Workshop.Text = ""
        End If
    End Sub
</script>

------------
code that calls the checkbox
<table cellpadding="0" cellspacing="0" style="border-color:gray" border="0">
<tr>
<td>
<asp:CheckBox ID="Workshop_One_Date" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBox1_CheckedChanged" />
</td>
<td>
<asp:TextBox ID="Date_of_First_Workshop" runat="server" Visible="false"></asp:TextBox>
</td>
</tr>
</table>
-------------
return from form:
First Name: luis
Last Name: hernandez
Title: test
Organization: hgac
Address: 3555 timmons
City: houston
State: tx
Zip Code: 77027
Phone #: 7134445555
Cell Phone #: 713445555
Email: luis.hernandez@h-gac.com
Workshop_One_Date: True
Date_of_First_Workshop: April 23, 2010
Workshop_Two_Date: True
Date_of_Second_Workshop: May 11, 2010
Your Comments:  : fema test 012
-------------
My question is: How can i keep the checkbox id from displaying and how can i make the textbox id display a name without the underscores?

Please help. thank you again for your time.
0
Codeaddict7423Author Commented:
rajapandian_81:
i've placed a hidden field next to a text box

<input id="Hidden1" type="hidden" runat="server" />

now i have programmed into the sub the following:      
Dim Hidden1 As HiddenField = RSVPForm1.FindControl("Hidden1")
Date_of_First_Workshop.Text = Hidden1.Value
i'm getting this error at runtime:
Unable to cast object of type 'System.Web.UI.HtmlControls.HtmlInputHidden' to type 'System.Web.UI.WebControls.HiddenField'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.UI.HtmlControls.HtmlInputHidden' to type 'System.Web.UI.WebControls.HiddenField'.

any thoughts as to how to get the value of a hidden field?


   
0
rajapandian_81Commented:
---------->  How can i keep the checkbox id displaying
You can use ID property to get id of checkbox like below.

        Dim strCheckBoxId As String
        strCheckBoxId = CheckBox1.ID()

OR

        Dim strCheckBoxId As String
        strCheckBoxId = Workshop_One_Date.ID()

------> how can i make the textbox id display a name without the underscores?
You can use Replace command to replace the underscores to blank space like below.

strCheckBoxId = strCheckBoxId.Replace("_", " ")
0
Codeaddict7423Author Commented:
rajapandian_81:
Thank you for your suggestion.
Below, please find my sub code. It's not working and still returns checkboxID with underscores. Can you please review and let me know where i went wrong?
----------
Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim Workshop_One_Date As CheckBox = CType(RSVPForm1.FindControl("Workshop_One_Date"), CheckBox)
        Dim Date_of_First_Workshop As TextBox = CType(RSVPForm1.FindControl("Date_of_First_Workshop"), TextBox)
     
        'Dim Hidden1 As HiddenField = RSVPForm1.FindControl("Hidden1")
       
        Date_of_First_Workshop.Visible = "false"
       
        Dim strWorkshop_One_Date As String
        strWorkshop_One_Date = Workshop_One_Date.ID()
       
        Dim strDate_of_First_Workshop As String
        strDate_of_First_Workshop = Date_of_First_Workshop.ID()
                 
        If Workshop_One_Date.Checked = True Then

            'Workshop_One_Date.Attributes.Add("April 23, 2010", ToString())
           
            strWorkshop_One_Date = strWorkshop_One_Date.Replace("_", " ")
           
            strDate_of_First_Workshop = strDate_of_First_Workshop.Replace("_", " ")
           
            Date_of_First_Workshop.Text = "April 23, 2010"
            Date_of_First_Workshop.Visible = "true"
            '  Date_of_First_Workshop.Text = Hidden1.Value
         
        Else
            Workshop_One_Date.Text = " "
            Date_of_First_Workshop.Text = ""
        End If
    End Sub
------------
0
rajapandian_81Commented:
After the line
strWorkshop_One_Date = strWorkshop_One_Date.Replace("_", " ")

Add below code
Page.ClientScript.RegisterStartupScript(Page.GetType(), "TxtBoxSelect", "<script language=JavaScript>alert('" + strWorkshop_One_Date + "');</script>")


So that when executing code, one popup message will come. In that message check value whether it has underscore or not.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Codeaddict7423Author Commented:
rajapandian 81,
Thank you. when i implemented your solution, it seems like placing the code breaks the "if -- End If" sub. My code is as follows:
-------
<script runat="server">
 
    Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim Workshop_One_Date As CheckBox = CType(RSVPForm1.FindControl("Workshop_One_Date"), CheckBox)
        Dim Date_of_First_Workshop As TextBox = CType(RSVPForm1.FindControl("Date_of_First_Workshop"), TextBox)
     
        'Dim Hidden1 As HiddenField = RSVPForm1.FindControl("Hidden1")
       
        Date_of_First_Workshop.Visible = "false"
       
        Dim strWorkshop_One_Date As String
        strWorkshop_One_Date = Workshop_One_Date.ID()
       
        Dim strDate_of_First_Workshop As String
        strDate_of_First_Workshop = Date_of_First_Workshop.ID()
                 
        If Workshop_One_Date.Checked = True Then

            Workshop_One_Date.LabelAttributes.Add("Workshop One Date", "April 23, 2010")
     
            strWorkshop_One_Date = strWorkshop_One_Date.Replace("_", " ")
           
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "TxtBoxSelect", "<script language=JavaScript>alert('" + strWorkshop_One_Date + "")</script>")
     
            strDate_of_First_Workshop = strDate_of_First_Workshop.Replace("_", " ")
           
            Date_of_First_Workshop.Text = "April 23, 2010"
            Date_of_First_Workshop.Visible = "true"
            '  Date_of_First_Workshop.Text = Hidden1.Value
         
        Else
            Workshop_One_Date.Text = " "
            Date_of_First_Workshop.Text = ""
        End If

       
    End Sub
</script>
---------

Also, I have been looking at the checkbox attribute:
                Dim Workshop_One_Date As New CheckBox
            Workshop_One_Date.LabelAttributes.Add("Date of Workshop", "April 23, 2010")

and placing that in the FormLoad sub. i got this from the following:
http://www.15seconds.com/issue/040804.htm 

maybe the checkbox has a lable attribute that can be accessed and display a different name, etc.
Thanks,
0
Codeaddict7423Author Commented:
Hello,
I have a user control with an asp:checkbox next to a description of a workshop. i'm being asked to program the checkbox so that when a user checks the checkbox, the checkbox control returns the name of the checkbox (in a string format with other than  the name of the checkbox) and a string value (other than just "true" or "false" .  For example, if checkbox ID="chk_workshop_01", i'm trying to replace the name of this checkbox control to "Workshop One Date:" and if "chk_workshop_01.checked = true" Then replace the value "true" with a string like "April 23, 2010"

I'm trying to work with the  labelattributes like this:
chk_workshop_01.LabelAttributes.Add("April 23, 2010", "lblWorkshop_01") but I'm not having any success.  

All i need is a return from the form is a checkbox control with a string name and a value other than "true" or "false" instead of "true" or "false"

Any help with this is greatly appreciated.
0
CodeCruiserCommented:
As I have been trying to tell you in your other question, you are on the wrong track. You either need to modify the code which is reading the value of the checkbox or you need to use a property in the usercontrol which you set according to the value of the checkbox. As I have asked in your other question, how are the values received from you usercontrol?
0
Codeaddict7423Author Commented:
Thank You very much!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.