Solved

get variable value from javascript into asp.net

Posted on 2010-11-14
4
806 Views
Last Modified: 2012-05-10
Hello,
 I have a user control form built using Visual Studio 2005 on vb.net with a JavaScript call to calculate total.
Below, please find my code:
-----------
 Protected Sub RSVPForm1_CalculateTotalEvent(ByVal e As HGACServerControls.CalculateTotalEventArgs)
        If (IsPostBack) Then
           
            Dim totalBox As HiddenField
                
           
            'find the control
            totalBox = RSVPForm1.FindControl("hdnTotal")
                       
            'Lets go ahead and throw an exception if the we could not find our total
            'If (totalBox Is Nothing) Then
            'Throw New Exception("Could not get total")
            'End If

            Try
                e.Total = CDec(Page.Request.Form(totalBox.UniqueID))
            Catch
                ' If Conversion does not work set to zero
                e.Total = New Decimal(0)
            End Try
                   
        End If
    End Sub
   
    Protected Sub RSVPForm1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim hdnTotal As HiddenField
       
        hdnTotal = RSVPForm1.FindControl("hdnTotal")
       
       
       
        If Not (hdnTotal Is Nothing) Then
            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "hdnTotalIdScript", "var hdnTotalId = '" + hdnTotal.ClientID + "';", True)
        End If
       
       
    End Sub
</script>
<script language="JavaScript" type="text/javascript">

function RegTotal()
{
form = document.forms[0];


if ((form.Total.value == "0") || (form.Total.value.length == 0))
      {      
      alert("Please enter a sponsorship amount before submitting the form.");
      }

var obj = document.getElementById(hdnTotalId);


obj.value = form.Total.value;

}
</script>
-----------
The call to this JavaScript is as follows:
----------
<tr>
     
      <td style="background-color:#FFFFBF"><strong><span style="color:Crimson">Amount sponsor: $ </span></strong></td>
      <td style="background-color:#FFFFBF"><INPUT TYPE=TEXT NAME="Total" SIZE=12 onChange="RegTotal();" value="0" style="background-color:#FFFFBF;font-weight:bold;" />      
      <asp:HiddenField ID="hdnTotal"  runat="server"/></td>  
   
</tr>
-------
I am attempting to duplicate the JavaScript function using VB.NET.  For example, I am trying to write a sub in vb.net specifically to capture the call this code:
-----------
var obj = document.getElementById(hdnTotalId);
obj.value = form.Total.value;
-------
of interest, is the call to "hdnTotalID".

ANY help would be greatly appreciated.

0
Comment
Question by:Codeaddict7423
  • 2
  • 2
4 Comments
 
LVL 35

Expert Comment

by:Miguel Oz
ID: 34133295
On page_load when you need it just write:
hdnTotal.Value
 to get he same value assigned by JS in your page
0
 

Author Comment

by:Codeaddict7423
ID: 34133526
mas_oz2003,

Thank you for the quick reply.
When i implemented your suggestion by entereing "hdnTotal.Value" at Page_Load, VS is indicating the folllowing: "name 'hdnTotal is not declared"
Below, please find my code:
-------
<%@ Control Language="VB" ClassName="RSVP_FreshAirFriday_PromoCode"  %>

<script runat="server">
 
   
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        'If (Not IsPostBack) Then
        'Dim lb As Label
           
        'lb = RSVPForm1.FindControl("OrderTotalAmount2")
           
        ' dd.Items.Add(New ListItem("Home Rule", "Home Rule"))
        ' dd.Items.Add(New ListItem("General Law", "General Law"))
         
        'End If
       
        hdnTotal.Value()

    End Sub
 
    Protected Sub RSVPForm1_CalculateTotalEvent(ByVal e As HGACServerControls.CalculateTotalEventArgs)
        If (IsPostBack) Then
           
            Dim totalBox As HiddenField
                
           
            'find the control
            totalBox = RSVPForm1.FindControl("hdnTotal")
                       
            'Lets go ahead and throw an exception if the we could not find our total
            'If (totalBox Is Nothing) Then
            'Throw New Exception("Could not get total")
            'End If

            Try
                e.Total = CDec(Page.Request.Form(totalBox.UniqueID))
            Catch
                ' If Conversion does not work set to zero
                e.Total = New Decimal(0)
            End Try
                   
        End If
    End Sub
   
    Protected Sub RSVPForm1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim hdnTotal As HiddenField
       
        hdnTotal = RSVPForm1.FindControl("hdnTotal")
       
       
       
        If Not (hdnTotal Is Nothing) Then
            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "hdnTotalIdScript", "var hdnTotalId = '" + hdnTotal.ClientID + "';", True)
        End If
       
       
    End Sub
</script>
<script language="JavaScript" type="text/javascript">

function RegTotal()
{
form = document.forms[0];


if ((form.Total.value == "0") || (form.Total.value.length == 0))
      {      
      alert("Please enter a sponsorship amount before submitting the form.");
      }

var obj = document.getElementById(hdnTotalId);


obj.value = form.Total.value;

}
</script>
<br />
-----------
The call to the "RegTotal" javascript is as follows:
-------
 <tr>
     
      <td style="background-color:#FFFFBF"><strong><span style="color:Crimson">Amount sponsor: $ </span></strong></td>
      <td style="background-color:#FFFFBF"><INPUT TYPE=TEXT NAME="Total" SIZE=12 onChange="RegTotal();" value="0" style="background-color:#FFFFBF;font-weight:bold;" />      
      <asp:HiddenField ID="hdnTotal"  runat="server"/></td>  
   
</tr>
 ------
What I'm ttrying to do is to write a sub in response to a button_click event that would provide the same results as the JavaScript script "RegTotal".  
For example, the RegTotal javascript returns the following:
--------
var obj = document.getElementById(hdnTotalId);

obj.value = form.Total.value;
-----
and I receive in my email the value of  the amount the user entered into the field
"><INPUT TYPE=TEXT NAME="Total" SIZE=12 onChange="RegTotal();" value="0" style="background-color:#FFFFBF;font-weight:bold;" />      
      <asp:HiddenField ID="hdnTotal"  runat="server"/>
-------

THe sub I'm attempting to write would return the value entered into hdnTotal as a numeric value. I think that in the javascript above, t his is called from the value "(hdnTotalId)"

ANY help in writing this sub would be greatly appreciated.
0
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 34133659
Strange, because you are declaring it for server usage in the markup as follows:
<asp:HiddenField ID="hdnTotal"  runat="server"/></
I notice that in your code you already have a Load method, use it in this way:(Note : Delete Page_Load)
    Protected Sub RSVPForm1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim hdnTotal As HiddenField
       
        hdnTotal = RSVPForm1.FindControl("hdnTotal")
        'Use hdnTotal, you can include in the if below for extra check
        Dim s As String = hdnTotal.Value.ToString()
        If Not (hdnTotal Is Nothing) Then
            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "hdnTotalIdScript", "var hdnTotalId = '" + hdnTotal.ClientID + "';", True)
        End If
       
       
    End Sub


Note: if it fails. Can you post your page markup?
0
 

Author Comment

by:Codeaddict7423
ID: 34133765
mas_oz2003,

Thank you for helping me. Actually, this is what I'm trying to do. I modifide a user control that had the previous "RegTotal" javascript into a form that checks for the existence of a promo code, performs a discount calculation if the promo code="true" and returns an email with hdnTotal calculated.
However, when i receive the return email, the value that is calculated from the use of the variable "hdnTotalId" within 'RegTotal' is 0.00
I'll post my user control for your review below:
--------
What is happening in this code is that i do not receive the value of "hdnTotalId" that was present in the javascript code of previous version of this form
(var obj = document.getElementById(hdnTotalId);
obj.value = form.Total.value;)

Apparently, the hdnTotalID is what returns the value of the "form.Total.Value;"
This is the last piece ofthe puzzle i need to activate this form.

Can you please review?

<%@ Control Language="VB" ClassName="RSVP_PedBike_Promo_Test01" Debug="true" AutoEventWireup="true" %>



<script runat="server">

   

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

        'If (Not IsPostBack) Then

        'Dim lb As Label    

        'lb = RSVPForm1.FindControl("OrderTotalAmount2")         

        ' dd.Items.Add(New ListItem("Home Rule", "Home Rule"))

        ' dd.Items.Add(New ListItem("General Law", "General Law"))

        'End If      

        

    End Sub

  

    Protected Sub RSVPForm1_CalculateTotalEvent(ByVal e As HGACServerControls.CalculateTotalEventArgs)

        If (IsPostBack) Then

            

            'Dim totalBox As HiddenField

            

            Dim totalBox As TextBox

        

       

            'find the control

            totalBox = RSVPForm1.FindControl("hdnTotal")

                

            'Throw an exception if we could not find the total

            'If (totalBox Is Nothing) Then

            'Throw New Exception("Could not get total")

            'End If



         

            Try

                e.Total = CDec(Page.Request.Form(totalBox.UniqueID))

                

            Catch

                ' If Conversion does not work set to zero

                e.Total = New Decimal(0)

                

            End Try

            

            

        End If

    End Sub



    Protected Sub RSVPForm1_Load(ByVal sender As Object, ByVal e As System.EventArgs)

        'Dim hdnTotal As HiddenField

        Dim hdnTotal As TextBox = RSVPForm1.FindControl("hdnTotal")

   

        ' Dim totalBox As TextBox = RSVPForm1.FindControl("hdnTotal")

        

        'Request.Form("hdnTotal")

        

        'hdnTotal = RSVPForm1.FindControl("hdnTotal")

     

        'hdnTotal.Text = ("25")

        'totalBox.text = ("35")

          

        If Not (hdnTotal Is Nothing) Then

            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "hdnTotalIdScript", "var hdnTotalId = '" + hdnTotal.ClientID + "';", True)

        End If

        

       

             

        

        

         

    End Sub

        



        

    Protected Sub btnVerifyPromos_Click(ByVal sender As Object, ByVal e As System.EventArgs)

               

        ' Creates myConnection as a new sqlconnection and sets it equal to DSN_PROD

        Dim myConnection As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("DSN_PROD").ConnectionString)

     

        myConnection.Open()



        ' Build a sql statement string    

        Dim query1 As String = "Select PromoCode, DiscountValue FROM tblPromoCodes WHERE PromoCode = @PromoCode"



        ' Initialize the sqlCommand with the new sql string.   

        Dim Command1 As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand(query1, myConnection)

        

        ' Declare txtPromoCode As TextBox and find in the form.

        Dim txtPromoCode As TextBox = DirectCast(RSVPForm1.FindControl("txtPromoCode"), TextBox)

        Dim lbl_Discount As Label = DirectCast(RSVPForm1.FindControl("lbl_Discount"), Label)

        Dim txtDiscountValue As TextBox = DirectCast(RSVPForm1.FindControl("txtDiscountValue"), TextBox)

        

        Command1.Parameters.AddWithValue("@PromoCode", txtPromoCode.Text)

        ' Command1.Parameters.AddWithValue("@DiscountValue", lbl_Discount.Text)

        'Command1.Parameters.AddWithValue("@DiscountValue", txtDiscountValue.Text)

        

        'If there is a single quote in the string below (Dim PromoCode As String = ""),            this causes validation of the to fail

        

        Dim PromoCode As String = ""



        'Dim DiscountValue As Int16 = "0"

        Dim DiscountValue As Integer = 0





        'Create new parameters for the sqlCommand object and initialize them to the input values.     



        'Execute the command

        Dim reader As System.Data.SqlClient.SqlDataReader = Command1.ExecuteReader

       

        If reader IsNot Nothing AndAlso reader.HasRows Then

            reader.Read()

            PromoCode = reader.GetString(0)

            DiscountValue = reader.GetInt32(1)

        End If



        ' Display whether the page passed validation. 

        Dim lbl_message As Label = DirectCast(RSVPForm1.FindControl("lbl_message"), Label)

          

        If Not String.IsNullOrEmpty(PromoCode) Then

         

            lbl_message.Text = "Promo Code Accepted."

            'Response.Write("--" + PromoCode.ToString() + "Accepted")

            lbl_Discount.Text = "Discount Applied."

            txtDiscountValue.Text = DiscountValue.ToString()



        Else

            lbl_message.Text = "Promo Code Invalid."

            'Response.Write("-- Not Accepted")

            lbl_Discount.Text = "Discount Not Applied."

            txtDiscountValue.Text = "0"



        End If



        ' args.IsValid = False

        

        If Not String.IsNullOrEmpty(PromoCode) Then

         

            lbl_message.Text = "Promo Code Accepted."

            ' Response.Write("--" + PromoCode.ToString() + "Accepted")

            lbl_Discount.Text = "Discount Applied."

            txtDiscountValue.Text = DiscountValue.ToString()

 

            

        Else

            lbl_message.Text = "Promo Code Invalid."

            'Response.Write("-- Not Accepted")

            lbl_Discount.Text = "Discount Not Applied."

            txtDiscountValue.Text = "0"



        End If



        '******* Calculate the event price if PromoCode isValid *********

        Dim txtTotal As TextBox = DirectCast(RSVPForm1.FindControl("txtTotal"), TextBox)

        Dim txtNumberofTickets As TextBox = DirectCast(RSVPForm1.FindControl("txtNumberofTickets"), TextBox)



        Dim hdnTotal As TextBox = DirectCast(RSVPForm1.FindControl("hdnTotal"), TextBox)

       

        If Not String.IsNullOrEmpty(txtNumberofTickets.Text) Then



            Dim nt As Integer = Convert.ToInt32((txtNumberofTickets.Text))

            Dim price As Integer = nt * 25

            

            'to have a percent discount from price, use the formula below like  this:

            'Dim total As Decimal = price - (price * DiscountValue / 100)

            

            'to have a hard-dollar discount from price, use the formula above like this:

            Dim total As Decimal = price - DiscountValue



            

            

            txtTotal.Text = total.ToString()

                        

            hdnTotal.Text = total.ToString()



            



        Else

            txtTotal.Text = "0"

        End If

        

       

      

        myConnection.Close()

        

               



    End Sub





  



</script>





<div style="text-align:center"></div>

                <h3 style="text-align:center"> <br /> 

               

                  <span style="color:#66686d; font-size:20px; font-weight:bold">REGISTRATION PROMO CODE TEST</span><br /> <br /><br />

</h3>

               



<HGACServerControls:RSVPForm ID="RSVPForm1" runat="server"  creditcardonly="false"  RSVPContactEmail="luis.hernandez@h-gac.com" RSVPFinancialCode="4000-108"  RSVPCode="Registration Promo Code Test" ShowBilling="True" OnCalculateTotalEvent="RSVPForm1_CalculateTotalEvent" ShowBillingTotalLabel="false" OnLoad="RSVPForm1_Load" Width="530px" >



<AdditionalFormControls>

   <p style="font-size: x-small; color: red; text-align: center"><br /><br />

    * denotes required fields.  <br /></p>

    



  

          <table width="520" cellpadding="0" cellspacing="0" style="border-color:white" border="0">

    

            <tr>

                <td style="text-align: right; white-space: nowrap; height: 25px; width:25%">

                    <asp:Label ID="lblFName" runat="server" AssociatedControlID="tb_FName" Text="First Name:"></asp:Label></td>

                    

                   <td style="text-align: left; white-space: nowrap; height: 25px; width:25%">

           

<asp:TextBox ID="tb_FName" runat="server"  Width="150px" MaxLength="150"  ></asp:TextBox >

                     

                 </td>

                    <td style="text-align: left; white-space: nowrap; height: 25px; width:5%">

                    &nbsp;<span style="color:red">*</span>

                    </td>

                   <td style="text-align: left; white-space: nowrap; height: 25px;  background-color:white">

                  <asp:RequiredFieldValidator ID="rfv_FName" runat="server" ControlToValidate="tb_FName" Display="Dynamic" ErrorMessage="First Name is required" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator>

                   

                   

                 </td>

                        

            </tr>

            <tr>

                <td style="text-align: right; white-space: nowrap; height: 25px; background-color:white">

                    <asp:Label ID="lblLName" runat="server" AssociatedControlID="tbLName" Text="Last Name:"></asp:Label></td>

                    

                   <td style="text-align: left; white-space: nowrap; height: 25px;  background-color:white">

                    <asp:TextBox ID="tbLName" runat="server"  Width="150px" MaxLength="200"></asp:TextBox>

                    </td>

                    <td style="text-align: left; white-space: nowrap; height: 25px;  background-color:white">

                    &nbsp;<span style="color:red">*</span>

                    </td>

                    <td style="text-align: left; white-space: nowrap; height: 25px;  background-color:white">

                 <asp:RequiredFieldValidator ID="rfv_LName" 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; height: 25px;">

                    <asp:Label ID="lblTitle" runat="server" AssociatedControlID="tbTitle" Text="Title:"></asp:Label></td>

                   <td style="text-align: left; white-space: nowrap; height: 25px;">

                    <asp:TextBox ID="tbTitle"  runat="server" Width="150px" MaxLength="200"></asp:TextBox>

                    </td>

                    <td style="text-align: right; white-space: nowrap; height: 25px;">&nbsp; </td>

          <td style="text-align: right; white-space: nowrap; height: 25px;">&nbsp; </td>

                    

            </tr>

            <tr>

                <td style="text-align: right; white-space: nowrap; height: 25px;">

                    <asp:Label ID="lblOrganization" runat="server" AssociatedControlID="tbOrganization" Text="Organization:"></asp:Label></td>

                   <td style="text-align: left; white-space: nowrap; height: 25px;">

                    <asp:TextBox ID="tbOrganization" runat="server" Width="150px" MaxLength="200"></asp:TextBox>

                   </td>

                   <td style="text-align: left; white-space: nowrap; height: 25px;">&nbsp;<span style="color:red">*</span></td>

          

                    <td style="text-align: left; white-space: nowrap; height: 25px;">

                         <asp:RequiredFieldValidator ID="rfv_Organization" 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; height: 25px;">

                    <asp:Label ID="lblAddress" runat="server" AssociatedControlID="tbAddress" Text="Street:"></asp:Label></td>

                <td style="text-align: left; white-space: nowrap; height: 25px;">

                    

                <asp:TextBox ID="tbAddress" runat="server"  Width="150px" MaxLength="200"></asp:TextBox>

                        </td>

                 <td style="text-align: left; white-space: nowrap; height: 25px;">

                 &nbsp;<span style="color:red">*</span></td>

                            

                 <td style="text-align: left; white-space: nowrap; height: 25px;">

                 

                 <asp:RequiredFieldValidator ID="rfv_Address" runat="server" ControlToValidate="tbAddress" Display="Dynamic" ErrorMessage="Street is required" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator> </td>

            </tr>

            

            <tr>

                <td style="text-align: right; white-space: nowrap; height: 25px;">

                    <asp:Label ID="lblCity" runat="server" AssociatedControlID="tbCity" Text="City:"></asp:Label></td>

                <td style="text-align: left; white-space: nowrap; height: 25px;">

                <asp:TextBox ID="tbCity" runat="server"  Width="150px" MaxLength="200"></asp:TextBox>

                  </td>

                <td style="text-align: left; white-space: nowrap; height: 25px;">

                 &nbsp;<span style="color:red">*</span></td>

                            

                   <td><asp:RequiredFieldValidator ID="rfv_City" 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; height: 25px; ">

                    <asp:Label ID="lblState" runat="server" AssociatedControlID="tbState" Text="State:"></asp:Label></td>

                <td style="text-align: left; white-space: nowrap; height: 25px;">

                <asp:TextBox ID="tbState" runat="server" Width="150px" MaxLength="200"></asp:TextBox>

                        </td>

                <td style="text-align: left; white-space: nowrap; height: 25px;">

                &nbsp;<span style="color:red">*</span></td>

                  <td><asp:RequiredFieldValidator ID="rfv_State" 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; height: 25px;">

                    <asp:Label ID="lblZipCode" runat="server" AssociatedControlID="tbZipCode" Text="Zip Code:"></asp:Label></td>

                <td style="text-align: left; white-space: nowrap; height: 25px;">

                <asp:TextBox ID="tbZipCode" runat="server"  Width="150px" MaxLength="100"></asp:TextBox></td>

                <td style="text-align: left; white-space: nowrap; height: 25px;">

                &nbsp;<span style="color:red">*</span></td>

                <td><asp:RequiredFieldValidator ID="rfv_ZipCode" runat="server" ControlToValidate="tbZipCode" Display="Dynamic" ErrorMessage="Zip Code is required" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator> </td>

            </tr>

            

             <tr>

                <td style="text-align: right; white-space: nowrap; height: 25px;">

                    <asp:Label ID="lblPhone" runat="server" AssociatedControlID="tbPhone" Text="Phone:"></asp:Label></td>

                <td style="text-align: left; white-space: nowrap; height: 25px;">

                <asp:TextBox ID="tbPhone" runat="server"  Width="150px" MaxLength="200"></asp:TextBox>

                    </td>

              <td style="text-align: left; white-space: nowrap; height: 25px;">

                &nbsp;<span style="color:red">*</span></td>

                        

                <td><asp:RequiredFieldValidator ID="rfv_Phone" 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; height: 25px;">

                    <asp:Label ID="lblCellPhone" runat="server" AssociatedControlID="tbCellPhone" Text="Cell:"></asp:Label></td>

                   <td style="text-align: left; white-space: nowrap; height: 25px;">

                    <asp:TextBox ID="tbCellPhone"  runat="server" Width="150px" MaxLength="200"></asp:TextBox>

                    </td>

                    <td style="text-align: right; white-space: nowrap; height: 25px;">&nbsp; </td>

          <td style="text-align: right; white-space: nowrap; height: 25px;">&nbsp; </td>

                    

            </tr>

            

            

             

              <tr>

                <td style="text-align: right; white-space: nowrap; height: 25px;">

                <asp:Label ID="lblEmail" runat="server" AssociatedControlID="tbEmail" Text="Email:"></asp:Label></td>

               <td style="text-align: left; white-space: nowrap; height: 25px;">

               <asp:TextBox ID="tbEmail" runat="server"  Width="150px" MaxLength="200" AutoPostBack="false" ></asp:TextBox></td>

               <td style="text-align: left; white-space: nowrap; height: 25px;">&nbsp;<span style="color:red">*</span></td>

               <td style="text-align: left; white-space: nowrap; height: 25px;">

                    <asp:RequiredFieldValidator ID="rfv_Email" runat="server" ControlToValidate="tbEmail" ErrorMessage="Email is required" Display="Dynamic" EnableClientScript="true" SetFocusOnError="true"></asp:RequiredFieldValidator>

                    <asp:RegularExpressionValidator ID="rfv_EmailValid" 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>

  

   

   

    <!--Promo Coupon call starts here /\/\/\/\/\/\/\/--> 

 

 <tr>

  <td style="text-align: right; white-space: nowrap; height: 25px; background-color:#FFFFFF">

<asp:Label ID="Label2" runat="server" Text="Promo Code:"></asp:Label>&nbsp;</td> 

      

<td style="text-align: left; white-space: nowrap; height: 25px;">

    <asp:TextBox ID="txtPromoCode" Width="150px" runat="server"></asp:TextBox>   

 </td>    

   

 <td style="text-align: left; white-space: nowrap; height: 25px;">&nbsp; </td> 

  

 <td style="text-align: left; white-space: nowrap; height: 25px;"><asp:Button ID="btnVerifyPromos" runat="server" OnClick="btnVerifyPromos_Click" Text="Verify"  /> 

     <asp:Label ID="lbl_message" runat="server" Text="" ></asp:Label><br />

     <asp:Label ID="lbl_Discount" runat="server" Text="" BackColor="white"></asp:Label>

 </td>      

  

  </tr>



   

   

   

  <tr>

  <td style="text-align: right; white-space: nowrap; height: 25px;">

<asp:Label ID="Label1" runat="server" Text="Number of Tickets:"></asp:Label>&nbsp;</td> 

      

<td style="text-align: left; white-space: nowrap; height: 25px;">    

<asp:TextBox ID="txtNumberofTickets" runat="server" Text="1" Width="150px" ReadOnly="true" BackColor="#ebebeb" ></asp:TextBox>

 </td>    

   

 <td style="text-align: left; white-space: nowrap; height: 25px;">&nbsp;</td> 

  

 <td style="text-align: left; white-space: nowrap; height: 25px;">

 

 <!-- 

 <input type="text" name="Regcount" size="2" style="background-color:#FFFFCC" readonly="readonly" /> --> 

 

 </td>      

  </tr>







 <!--Discount Value starts here /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\--> 

 

 

  <tr>

  <td style="text-align: right; white-space: nowrap; height: 25px;"><asp:Label ID="lbl_discamt" runat="server" Text="Discount Amount:"></asp:Label>&nbsp;</td> 

      

<td style="text-align: left; white-space: nowrap; height: 25px; background-color:white"><asp:TextBox ID="txtDiscountValue" Width="150px" runat="server" ReadOnly="true" BackColor="#F0F0F0" Text="" ></asp:TextBox>

</td>    

   

 <td style="text-align: left; white-space: nowrap; height: 25px;">&nbsp;</td> 

  

 <td style="text-align: left; white-space: nowrap; height: 25px;">&nbsp; </td>      

  

  </tr>

  

  <!--Discount Value ends here /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\--> 

 

  

    <tr>

              <td style="text-align: right; white-space: nowrap; height: 25px; vertical-align:top">

              <asp:Label ID="lblTotal" runat="server" ForeColor="crimson" Font-Bold="true" Text="Total : $"></asp:Label></td>

              <td style="text-align: left; white-space: nowrap; height: 25px;">

        

   <!--location of Total field --> 

   

  <!--              

  <input type="text" name="Total" size="23" value="" style="background-color:#FFFFCC;font-weight:bold;color:#FF0000;" readonly="readonly" disabled="disabled"/>  

 -->     



 

 <asp:TextBox ID="txtTotal" runat="server" Width="100px" Enabled="false"></asp:TextBox>

 



 

  <!--location of hdnTotal field --> 

  

               <asp:TextBox ID="hdnTotal"  Width="150px" runat="server" ReadOnly="true"  Visible="false" BorderColor="red" ></asp:TextBox>

              

</td>

              <td style="text-align: left; white-space: nowrap; height: 25px; background-color:white">&nbsp;</td>         <td style="text-align: left; white-space: nowrap; height: 25px; background-color:white">&nbsp;</td>      

                    

            </tr>

  

             </table>

             

              <p></p>

             <hr />

             





            

</AdditionalFormControls>

        <RSVPResponseText>

            <font face="Arial, Helvetica, sans-serif">

            Thank you for registering! Your payment has been received. <br /> 

If you have questions please contact Gina Mitteco:<br /> 

(713) 993-4583<br /> 

 <a href="mailto:gina.mitteco@h-gac.com">gina.mitteco@h-gac.com</a>. 

            

<br /><br />

Please print this confirmation for your records.



     </font>

        </RSVPResponseText>

</HGACServerControls:RSVPForm>

    &nbsp;

Open in new window

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now