convert a boolean value to a string

Hello,
How do i convert a boolean value ("true" / "false" ) to a string value?
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.

Alpesh PatelCommented:
convert the variable to string like this

dim xbol as boolean
dim strbol as string
xbol="True"


strbol= xbol.Tostring
0
Carl TawnSystems and Integration DeveloperCommented:
Do you mean from an actual bool type or from a literal "true" or "false" string?
0
Codeaddict7423Author Commented:
CONCEPTINFOTECH:
Thanks for the quick reply.  I'm using visual studio 2005 progammig in vb.net. i have a form tha contains a checkbox control. this control,  when checked, i'd like to return a value other than "true" or "false". I have a sub like this:
------------
<script runat="server">

    Protected Sub chk_workshop01_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim chk_workshop01 As CheckBox = CType(RSVPForm1.FindControl("chk_workshop01"), CheckBox)
       
        Dim strchk_workshop01 As String
        strchk_workshop01 = chk_workshop01.ID("chk_workshop01")

       
        If chk_workshop01.Checked.ToString = True Then
            strchk_workshop01 = strchk_workshop01.Replace("chk_workshop01", "Workshop One Date")

            'chk_workshop01.Text = "April 23"
            'chk_workshop01.BackColor = Drawing.Color.Blue
            'chk_workshop01.InputAttributes.Add("April 23, 2010", "workshop01 Date")
   
        Else
            chk_workshop01.Text = "nothing"
           
        End If    
       
    End Sub
           
</script>
-----------

All i'm trying to do is to have the control "checkbox1" return a value other than "true" when checked or "false" when not checked.   I'd like to have a solution such that when the checkbox is checked, it returns a string value like "April 23, 2010" .  I tried to do a conversion  using "CType" but it doesn't seem to work.  Any help is greatly appreciated.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

CodeCruiserCommented:
Try this

IIF(checkbox1.Checked, "April 23, 2010", "01/01/1900")
0
CodeCruiserCommented:
By the way, you dont use ToString to compare booleans!

>chk_workshop01.Checked.ToString = True
0
13598Commented:
Try this:
------------
<script runat="server">

    Protected Sub chk_workshop01_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim chk_workshop01 As CheckBox = CType(RSVPForm1.FindControl("chk_workshop01"), CheckBox)
       
        Dim strchk_workshop01 As String
        strchk_workshop01 = chk_workshop01.ID("chk_workshop01")

       
        If chk_workshop01.Checked  Then
            strchk_workshop01 = strchk_workshop01.Replace("chk_workshop01", "Workshop One Date")

            'chk_workshop01.Text = "April 23"
            'chk_workshop01.BackColor = Drawing.Color.Blue
            'chk_workshop01.InputAttributes.Add("April 23, 2010", "workshop01 Date")
   
        Else
            chk_workshop01.Text = "nothing"
           
        End If    
       
    End Sub
           
</script>
-----------
0
13598Commented:
Do you want to change the checkbox text?
If so:
Try this:
------------
<script runat="server">

    Protected Sub chk_workshop01_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim chk_workshop01 As CheckBox = CType(RSVPForm1.FindControl("chk_workshop01"), CheckBox)
       
        Dim strchk_workshop01 As String
        strchk_workshop01 = chk_workshop01.ID("chk_workshop01")

       
        If chk_workshop01.Checked  Then
        ' Im not sure what  you are doing here    strchk_workshop01 = strchk_workshop01.Replace("chk_workshop01", "Workshop One Date")

           chk_workshop01.Text = "April 23"
            'chk_workshop01.BackColor = Drawing.Color.Blue
            'chk_workshop01.InputAttributes.Add("April 23, 2010", "workshop01 Date")
   
        Else
            chk_workshop01.Text = ""
           
        End If    
       
    End Sub
           
</script>
-----------
0
13598Commented:
Also:
The CheckedChanged event is raised when the value of the Checked property changes between posts to the server. This event does not post the page back to the server unless the AutoPostBack property is set to true.

Note:
A CheckBox control must persist some values between posts to the server for this event to work correctly. Be sure that view state is enabled for this control.
 
0
Codeaddict7423Author Commented:
13598:
Thanks for the quick reply.
my sub code is below:
------
<script runat="server">

    Protected Sub chk_workshop01_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim chk_workshop01 As CheckBox = CType(RSVPForm1.FindControl("chk_workshop01"), CheckBox)
       
        If chk_workshop01.Checked = True Then
           
            IIf(chk_workshop01.Checked, "April 23, 2010", "01/01/1900")
   
        Else
            chk_workshop01.Text = "nothing"
           
        End If
       
    End Sub
           
</script>
---------

what I'm trying to get to is a checkbox that returns a string like "April 23, 2010" instead of "true" (when checked) and "false" (when not checked).  my next issue is getting the checkbox name to not be "chk_workshop01" but a string something like "workshop one".

thanks again for the quick reply
0
CodeCruiserCommented:
>returns a string like "April 23, 2010"

Returns to where?
0
Codeaddict7423Author Commented:
CodeCruiser:

Sorry, i was vague. This is a user control that is published inside a page (*.aspx). the control is for a RSVP form where users place a resevation for an event. When users complete the form and click on the checkbox, the "submit" button sends this information back to me with the details of the form's textboxes. i'm trying to get this checkbox (chk_workshop01) to return a value by email such that i can see instead of "chk_workshop01" a string like "workshop one date" and a value from that checkbox in a string format like "April 23, 2010" (instead of "true" when checked or "false" when not checked) .

0
13598Commented:
You would need to construct your own control for that if I understand what you are saying.
Could you elaborate on what you want your page to do and maybe there is an easier/faster way to accomplish the end result?
0
13598Commented:
Forget about last post. After I posted it I saw your recent comment .
0
CodeCruiserCommented:
>When users complete the form and click on the checkbox, the "submit" button sends this information back to me with the details of the form's textboxes.

That is why my IIF construct would be useful. So for example, in your code behind, you prepare this email to be sent out and you compose it like this

email.Body = "Following is the form data: " & IIF(checkbox1.Checked, "Workshop one date=April 23, 2010", "nothing")
0
Codeaddict7423Author Commented:
CodeCruiser:
Thanks for your quick reply.
I have the following construct:
-------
<script runat="server">
    Protected Sub chk_workshop01_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim chk_workshop01 As CheckBox = CType(RSVPForm1.FindControl("chk_workshop01"), CheckBox)
        If chk_workshop01.Checked = True Then
           
            IIf(chk_workshop01.Checked, "April 23, 2010", "01/01/1900")
   
        Else
            chk_workshop01.Text = "nothing"  
        End If
    End Sub  
</script>
---------
LIkely, i have your suggestion in the wrong place.  Any help would be greatly appreciated.
0
CodeCruiserCommented:
You are not sending email in this checkbox changed event. You need to get the information into email right?  Then use this statement

IIf(chk_workshop01.Checked, "April 23, 2010", "01/01/1900")

where ever you need to get the value of the checkbox as a string.
0
Codeaddict7423Author Commented:
CodeCruiser:
Thank you. if you could review my previous sub and let me know if syntax is correct, i'll try to run it now.
0
CodeCruiserCommented:
Ok. Try replacing this line

IIf(chk_workshop01.Checked, "April 23, 2010", "01/01/1900")

with this

chk_workshop01.Text=IIf(chk_workshop01.Checked, "April 23, 2010", "01/01/1900")
0
Codeaddict7423Author Commented:
CodeCruiser:

thanks for the quick reply. i replaced the line with your suggestion
My new construct is like this:
----------
<script runat="server">
    Protected Sub chk_workshop01_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)  
        Dim chk_workshop01 As CheckBox = CType(RSVPForm1.FindControl("chk_workshop01"), CheckBox)
        If chk_workshop01.Checked = True Then

            chk_workshop01.Text = IIf(chk_workshop01.Checked, "April 23, 2010", "01/01/1900")
   
        Else
            chk_workshop01.Text = "nothing"    
        End If
    End Sub    
</script>
---------

when running the page, i got this error  message:
Object reference not set to an instance of an object.
0
CodeCruiserCommented:
Its because the following line

Dim chk_workshop01 As CheckBox = CType(RSVPForm1.FindControl("chk_workshop01"), CheckBox)

is returning you null (no control is found with that ID).
0
Codeaddict7423Author Commented:
CodeCruiser:

Thanks for the quick reply.
I have this as a checkbox control:
 
<asp:CheckBox ID="chk_workshop01" runat="server" AutoPostBack="true" Text = "chk_workshop01 "  />
 i'm puzzled as to why i get this error


0
CodeCruiserCommented:
Finding the control on the client side in ASP.NET usually becomes a nightmare. ASP.NET appends the parent container names to control names. Try View Page Source and see what name is given to the checkbox.
0
Codeaddict7423Author Commented:
CodeCruiser:
let me go back to a version that i know works and try yiour solution....just a few mins
0
Codeaddict7423Author Commented:
CodeCruiser:
I just tested the form and got a reply  back from the server. in the series of textboxes, i got this line referring to the checkbox we just worked on:

chk_workshop01: True

no other info about dates
the sub looks like this:
------
Protected Sub chk_workshop01_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim chk_workshop01 As CheckBox = CType(RSVPForm1.FindControl("chk_workshop01"), CheckBox)
       
        If chk_workshop01.Checked = True Then
           
           
           
            chk_workshop01.Text = IIf(chk_workshop01.Checked, "April 23, 2010", "01/01/1900")
   
        Else
            chk_workshop01.Text = "nothing"
           
        End If
       
    End Sub
----------

Please  help
0
CodeCruiserCommented:
Now it depends on how the server is processing the checkbox. That is the reason I have been telling you to use the IIF function somewhere where you use the checkbox value. Does the serverside use the checkbox name as you are setting the checkbox name based on true/false.
0
Codeaddict7423Author Commented:
CodeCruiser:
Yes, below please see the return from the form:
---
Rsvp #: 103165
First Name: test-07_luis
Last Name: test-07_hernandez
Title: test-07_test
Organization: test-07_H-GAC
Address: test-07_3555 timmons
City: test-07_houston
State: test-07_tx
Zip Code: test-07_77027
Phone #: 713499669
Cell Phone #: 713446654
Email: luis.hernandez@h-gac.com
Date of Workshop: April 23, 2010 - testTrue: True
chk_workshop01: True
Date of Workshop: May 11, 2010True: True
Your Comments: : test-07_fema test 7
-------
what i'm trying to get is a return such that "chk_workshop01" reads something like "workshop one date" and its value, instead of "true", reads like "April 23, 2010"


0
Codeaddict7423Author Commented:
CodeCruiser:

I  have been reading abouit "LabelAttributes", do you thknk this might be a workaround?
------
Protected Sub chk_workshop01_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim chk_workshop01 As CheckBox = CType(RSVPForm1.FindControl("chk_workshop01"), CheckBox)
       
        If chk_workshop01.Checked = True Then
           
            chk_workshop01.LabelAttributes.Add("April 23, 2010", "Workshop One Date")
   
           
          '  chk_workshop01.Text = IIf(chk_workshop01.Checked, "April 23, 2010", "01/01/1900")
   
        Else
            chk_workshop01.Text = "nothing"
           
        End If
       
    End Sub
----------

thanks
     
0
CodeCruiserCommented:
Show me the code which composes the following text

Rsvp #: 103165
First Name: test-07_luis
Last Name: test-07_hernandez
Title: test-07_test
Organization: test-07_H-GAC
Address: test-07_3555 timmons
City: test-07_houston
State: test-07_tx
Zip Code: test-07_77027
Phone #: 713499669
Cell Phone #: 713446654
Email: luis.hernandez@h-gac.com
Date of Workshop: April 23, 2010 - testTrue: True
chk_workshop01: True
Date of Workshop: May 11, 2010True: True
Your Comments: : test-07_fema test 7
0
Codeaddict7423Author Commented:
CodeCruiser:

Below, please find the code that generates the  response text.
------------
<%@ Control Language="VB" ClassName="RSVP_FEMAnopaychkbox" %>

<script runat="server">
 
    Protected Sub RSVPForm1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
       
        If (Not IsPostBack) Then
         
           
            ' Dim Date_of_First_Workshop As TextBox = CType(RSVPForm1.FindControl("Date_of_First_Workshop"), TextBox)
            Dim lblWorkshop_01 As Label = CType(RSVPForm1.FindControl("lblWorkshop_01"), Label)
     
            ' Date_of_First_Workshop.Visible = "false"
            lblWorkshop_01.Visible = "false"
           
           
            'Dim Date_of_Second_Workshop As TextBox = CType(RSVPForm1.FindControl("Date_of_Second_Workshop"), TextBox)
           
            Dim lblWorkshop_02 As Label = CType(RSVPForm1.FindControl("lblWorkshop_02"), Label)
           
            'Date_of_Second_Workshop.Visible = "false"
            lblWorkshop_02.Visible = "false"
           
            Dim Workshop_One_Date As New CheckBox
            Workshop_One_Date.LabelAttributes.Add("Date of Workshop", "April 23, 2010")

           
            Dim Workshop_Two_Date As New CheckBox
            Workshop_Two_Date.LabelAttributes.Add("Date of Workshop", "May 11, 2010")
           
         

           
        End If
    End Sub

   
   
   
   
</script>

<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 lblWorkshop_01 As Label = CType(RSVPForm1.FindControl("lblWorkshop_01"), Label)
        lblWorkshop_01.Visible = "false"
         
        'Dim Hidden1 As HiddenField = RSVPForm1.FindControl("Hidden1")
       
        'Date_of_First_Workshop.Visible = "false"
       
        ' Dim msg As String = "You selected "
        Dim lbl_dateofworkshopone As New Label

        'If Workshop_One_Date.Checked = True Then
        'msg = msg & Workshop_One_Date.Text
       
        ' End If
        'lbl_dateofworkshopone.Text = msg
       
        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("April 23, 2010", "Workshop One Date")
           
            Workshop_One_Date.Checked.ToString()
           
            Workshop_One_Date.InputAttributes.Add("April 23, 2010", "Workshop One Date")
           
            lblWorkshop_01.Visible = "true"
           
            lblWorkshop_01.Text = "Date of Workshop: April 23, 2010 - test" & Workshop_One_Date.Checked.ToString()
           
            'lblWorkshop_01.Text = "Date of Workshop: April 23, 2010"
           
            'Date_of_First_Workshop.Text = "April 23, 2010"
            'Date_of_First_Workshop.Visible = "true"
            'Date_of_First_Workshop.Text = Hidden1.Value
           
            'strWorkshop_One_Date = strWorkshop_One_Date.Replace("_", " ")

            'strDate_of_First_Workshop = strDate_of_First_Workshop.Replace("_", " ")
           
                     
        Else
            Workshop_One_Date.Text = " "
            ' Date_of_First_Workshop.Text = ""
            lblWorkshop_01.Visible = "false"
        End If

       
    End Sub
</script>

<script runat="server">
 
    Protected Sub CheckBox2_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim Workshop_Two_Date As CheckBox = CType(RSVPForm1.FindControl("Workshop_Two_Date"), CheckBox)
        'Dim Date_of_Second_Workshop As TextBox = CType(RSVPForm1.FindControl("Date_of_Second_Workshop"), TextBox)
       
        Dim lblWorkshop_02 As Label = CType(RSVPForm1.FindControl("lblWorkshop_02"), Label)
   
       
        'Date_of_Second_Workshop.Visible = "false"
        lblWorkshop_02.Visible = "false"
       
        If Workshop_Two_Date.Checked = True Then
           
            lblWorkshop_02.Visible = "true"
            lblWorkshop_02.Text = "Date of Workshop: May 11, 2010" & Workshop_Two_Date.Checked.ToString()
       
           
           
            'Date_of_Second_Workshop.Text = "May 11, 2010"
            'Date_of_Second_Workshop.Visible = "true"
            lblWorkshop_02.Visible = "true"
        Else
            Workshop_Two_Date.Text = " "
            ' Date_of_Second_Workshop.Text = ""
            lblWorkshop_02.Visible = "false"
           
           
        End If
    End Sub
</script>



<script runat="server">

    Protected Sub chk_workshop01_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
       
        Dim chk_workshop01 As CheckBox = CType(RSVPForm1.FindControl("chk_workshop01"), CheckBox)
       
        If chk_workshop01.Checked = True Then
           
           
            chk_workshop01.LabelAttributes.Add("April 23, 2010", "Workshop One Date")
   
            'chk_workshop01.Text = IIf(chk_workshop01.Checked, "April 23, 2010", "01/01/1900")
   
        Else
            chk_workshop01.Text = "nothing"
           
        End If
       
    End Sub
           
</script>


    <HGACServerControls:RSVPForm ID="RSVPForm1" runat="server" RSVPContactEmail="luis.hernandez@h-gac.com" OnLoad="RSVPForm1_Load" RSVPCode="FEMA Workshop Registration Form" Width="530px"><AdditionalFormControls>
       
       
        <p style="font-size: x-small; color: red; text-align: center"><br /><br />
    * denotes required fields.  <br /></p>
   
   
 <table width="620" cellpadding="0" cellspacing="0" style="border-color:blue" border="0">
     <tr>
  <td colspan="4" style="width:100%" valign="top" align="left"><strong><span style="color:crimson">Contact Information</span></strong><br /></td>
  </tr>
  <tr>
  <td colspan="4" style="width:100%" valign="top" align="center">&nbsp;&nbsp; </td>
  </tr>

    <tr>
   <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label2" runat="server" AssociatedControlID="tbFName" Text="First Name:"></asp:Label>&nbsp;&nbsp;</td>    
       <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbFName" runat="server" Width="190px"></asp:TextBox></span></td>
     <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%"><span style="color: red">*</span>&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbFName" Display="Dynamic" ErrorMessage="First Name is required"    EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator>   </td></tr>
     
     
      <tr>
   <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label1" runat="server" AssociatedControlID="tbLName" Text="Last Name:"></asp:Label>&nbsp;&nbsp;</td>    
       <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbLName" runat="server" Width="190px"></asp:TextBox></span></td>
     <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%"><span style="color: red">*</span>&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="tbLName" Display="Dynamic" ErrorMessage="Last Name is required"   EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator>   </td></tr>
     
      <tr>
     <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label6" runat="server" AssociatedControlID="tbTitle" Text="Title:"></asp:Label> &nbsp;</td>
     <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbTitle" runat="server" Width="190px"></asp:TextBox> </span> </td>
     <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%">&nbsp;     </td>
       </tr>
     <tr>
   <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label3" runat="server" AssociatedControlID="tbOrganization" Text="Organization:"></asp:Label>&nbsp;&nbsp;</td>
   <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbOrganization" runat="server" Width="190px"></asp:TextBox></span></td>
    <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%"><span style="color: red">*</span>&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbOrganization" ErrorMessage="Organization is required" Display="Dynamic" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator></td></tr>
     <tr>
     <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label100" runat="server" AssociatedControlID="tbAddres" Text="Address:"></asp:Label> &nbsp;</td>
     <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbAddres" runat="server" Width="190px"></asp:TextBox></span> </td>
     <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%"><span style="color: red">*</span>&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="tbAddres" ErrorMessage="Address is required" Display="Dynamic" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator></td>
       </tr>
  <tr>
     <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label8" runat="server" AssociatedControlID="tbCity" Text="City:"></asp:Label> &nbsp;</td>
        <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbCity" runat="server" Width="190px"></asp:TextBox> </span> </td>
     <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%"><span style="color: red">*</span>&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="tbCity" Display="Dynamic" ErrorMessage="City is required" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator>    </td>
       </tr>
     
      <tr>
     <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label9" runat="server" AssociatedControlID="tbState" Text="State:"></asp:Label>   &nbsp;</td>
     <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbState" runat="server" Width="190px"></asp:TextBox>  </span> </td>
     <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%"><span style="color: red">*</span>&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="tbState" Display="Dynamic" ErrorMessage="State is required" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator>     </td>
       </tr>
       
        <tr>
     <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label10" runat="server" AssociatedControlID="tbZip" Text="Zip Code:"></asp:Label>  &nbsp;</td>
     <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbZip" runat="server" Width="190px"></asp:TextBox>  </span> </td>
     <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%"><span style="color: red">*</span>&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="tbZip" ErrorMessage="Zip Code is required" Display="Dynamic" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator>     </td>
       </tr>
     
     
     
     
     <tr>
   <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label5" runat="server" AssociatedControlID="tbPhone" Text="Phone #:"></asp:Label>&nbsp;&nbsp;</td>
   <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbPhone" runat="server" Width="190px"></asp:TextBox></span> </td>
   <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%"><span style="color: red">*</span>&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="tbPhone" ErrorMessage="Phone is required" Display="Dynamic" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator></td></tr>
   
    <tr>
     <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label11" runat="server" AssociatedControlID="tbCellPhone" Text="Cell Phone #:"></asp:Label>  &nbsp;</td>
     <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbCellPhone" runat="server" Width="190px"></asp:TextBox> </span> </td>
     <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%">&nbsp;     </td>
       </tr>
       
       <tr>
   <td style="text-align: right; white-space: nowrap; width: 30%"><asp:Label ID="Label4" runat="server" AssociatedControlID="tbEmail" Text="Email:"></asp:Label>&nbsp;&nbsp;</td>
   <td style="text-align: left; white-space: nowrap; width: 25%"><span><asp:TextBox ID="tbEmail" runat="server" Width="190px"></asp:TextBox></span></td>
   
   <td colspan="2" style="text-align: left; white-space: nowrap; width: 20%"><span style="color: red">*</span>&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ControlToValidate="tbEmail" ErrorMessage="Email is required" Display="Dynamic" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="tbEmail" ValidationExpression="^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$" Display="Dynamic" ErrorMessage="Enter Valid e-mail"></asp:RegularExpressionValidator>
   
   
   </td></tr>
   
   
   
   
   
    <tr>
  <td colspan="4" style="width:100%" valign="top" align="center">&nbsp; </td>
  </tr>
  <tr>
  <td colspan="4" style="width:100%" valign="top" align="center"><hr /> </td>
  </tr>
     <tr>
  <td colspan="4" style="width:100%" valign="top" align="center">&nbsp; </td>
  </tr>
  <tr>
  <td colspan="4" style="width:100%" valign="top" align="left"><strong><span style="color:crimson">Workshop Information</span></strong><br /> </td>
  </tr>
  <tr>
  <td colspan="4" style="width:100%" valign="top" align="center">&nbsp;&nbsp; </td>
  </tr>
   
   <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%">
 
&nbsp;


    </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span>

<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" Text="  "    />

    <asp:Label ID="lblWorkshop_01" runat="server" AssociatedControlID="Workshop_One_Date" Text=" " BackColor="Gray"></asp:Label>
   
    <asp:CheckBox ID="chk_workshop01" runat="server" AutoPostBack="true" Text = "chk_workshop01 "  />



</td>
<td>
   
    &nbsp;



</td>
</tr>
</table>


</span>  

 </td>
 </tr>

   
 
  <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">Workshop 1:&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="color:#4b8a08; font-size:11px">Local Official’s Guide to Coastal Construction</span></td>
 </tr>
  <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">Date:&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="color:#08088a; font-size:11px">Friday, April 23, 2010</span></td>
 </tr>
   <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">Time:&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="font-size:11px">8:00 am – 5:00 pm</span></td>
 </tr>
  <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">Location:&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="font-size:11px"><a class="null" title="Directions Community Resource Center" href="http://www.unitedwayhouston.org/default/pdfs/uw_directions.pdf">United Way<br />Community Resource Center</a><br />
50 Waugh Drive<br />
Houston, TX 77007</span></td>
 </tr>
   <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">Cost:&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="font-size:11px">There is no fee for this workshop.</span></td>
 </tr>
 
 
 
  <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="font-size:11px">&nbsp; </span></td>
 </tr>

 

  <tr>
  <td colspan="4" style="width:100%" valign="top" align="center"><hr /> </td>
  </tr>
 
  <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%">
&nbsp;
   </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span>
<table cellpadding="0" cellspacing="0" style="border-color:gray" border="0">
<tr>
<td>
<asp:CheckBox ID="Workshop_Two_Date" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBox2_CheckedChanged" />

    <asp:Label ID="lblWorkshop_02" runat="server" AssociatedControlID="Workshop_Two_Date" Text=" " BackColor="Gray"></asp:Label>
</td>
<td>
&nbsp;

</td>

</tr>
 
 
</table>

</td>
 </tr>
   
 
  <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">Workshop 2:&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="color:#4b8a08; font-size:11px">Coastal Construction Workshop for Homebuilders and <br />
Introduction to Coastal Foundation Design and Construction for Local Officials
</span></td>
 </tr>
 <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">Date:&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="color:#08088a; font-size:11px">Tuesday, May 11, 2010</span></td>
 </tr>
 <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">Time:&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="font-size:11px">8:00 am – 5:00 pm</span></td>
 </tr>
  <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">Location:&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="font-size:11px"><a class="null" title="Directions to H-GAC" href="http://www.h-gac.com/contact/Map/default.aspx">Houston-Galveston Area Council</a><br />
3555 Timmons Lane</a><br />
2nd Floor Conference Room A, Suite 120<br />
Houston, TX 77027</span></td>
 </tr>
   <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">Cost:&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="font-size:11px">There is no fee for this workshop.</span></td>
 </tr>
 
 
  <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"><span style="font-size:11px">&nbsp;&nbsp;</span> </td>
   <td colspan="3" style="text-align: left; vertical-align:top; width: 70%; background-color:white"><span style="font-size:11px">&nbsp; </span></td>
 </tr>

 <tr>
  <td colspan="4" style="width:100%" valign="top" align="center"><hr /> </td>
  </tr>
<tr>
  <td colspan="4" style="width:100%" valign="top" align="center">&nbsp;&nbsp; </td>
  </tr>
  <tr>
   <td style="text-align: right; vertical-align:top; white-space: nowrap; width: 30%"> <asp:Label ID="Label7" runat="server" Text="Your Comments:&nbsp;&nbsp;" AssociatedControlID="tbComments"></asp:Label></td>    
       <td colspan="3" style="text-align: left;  width: 70%"><span>
       <asp:TextBox ID="tbComments" runat="server" TextMode="MultiLine" Height="80" Width="90%"></asp:TextBox>
       </td>
     </tr>
   
 
     
    </table>    
        <br /> <br />        
</AdditionalFormControls>

</HGACServerControls:RSVPForm>
--------------
Again, all i'm trying to get is a return from the "chk_workshop01" control to read something like "workshop one date" and its value, instead of "true" or "false" to read something like "April 23, 2010"
. Then i can replicate that into my other checkbox for one additional event date (May 11, 2010).
I'm desperate for a solution.  Please help.

0
CodeCruiserCommented:
Use a hidden control in your usercontrol. Name this control as "Workshop one date" and in the checkchanged, set the value of this control accordingly. Then return this control to the outside world instead of the checkbox.
0
Codeaddict7423Author Commented:
CodeCruiser:
Thank you for the quick reply. If i understand you correctly, you're talking about passing a value from the checkbox to another control (hidden control), then returning the value of that hidden control (as you would with a label control or textbox control) in the return.  ....
Actually, i've done that, i'm being asked to write code to return a checkbox control (renamed to something like a string) and its value (again so that it does not say "true" or "false" but with a string like "April 23"

Also, how do i keep the checkbox control from displaying  its name (ID) in the return email?
0
CodeCruiserCommented:
>Also, how do i keep the checkbox control from displaying  its name (ID) in the return email?

I have been trying to explain to you for long time now that you need to change the code which accesses this control and retrieves its value(to use in email). You have not shown the code which sends the email yet!
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:
CodeCruiser:
Thank youi for the quick reply. There is a proprietary code that handles the email in a _baseclass file. I'll edit that and try the form again.
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
.NET Programming

From novice to tech pro — start learning today.