Dim DSN_PROD As System.Data.SqlClient.SqlConnection
DSN_PROD = New System.Data.SqlClient.SqlConnection("myconnection")
DSN_PROD.Open()
' Build a sql statement string
Dim query1 As String = "Select PromoCode 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, DSN_PROD)
Dim PromoCode As Object
'Create new parameters for the sqlCommand object and initialize them to the input values.
Command1.Parameters.AddWithValue("@PromoCode", PromoCode)
'Execute the command
PromoCode = Command1.ExecuteScalar
DSN_PROD.Close()
<%@ Control Language="VB" ClassName="RSVP_PedBike_Promo_Test01" %>
<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
' Dim total As HiddenField
' Dim txtPromoCode As TextBox
'Dim txtDiscountValue As HiddenField
' Dim hdnTotal 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
'If txtPromoCode.Text.Length > 0 Then
'Dim Discount As Decimal = (totalBox * Integer.Parse(txtPromoCode.Text)) / 100
' txtDiscountValue.Value = txtDiscountValue.ToString
' total = total.Value - txtDiscountValue.Value
'End If
'txtDiscountValue.Value = total.ToString("$0.00")
'hdnTotal.Text = total.ToString("$0.00")
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")
' Dim Attendee_FName As HiddenField
'Request.Form("hdnTotal")
'hdnTotal = RSVPForm1.FindControl("hdnTotal")
'Attendee_FName = RSVPForm1.FindControl("Attendee_FName")
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
' If Not (Attendee_FName Is Nothing) Then
'Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "Attendee_FNameIdScript", "var Attendee_FNameId = '" + Attendee_FName.ClientID + "';", True)
' End If
End Sub
Private Sub CVPromoCode_ServerValidate_ServerValidate(ByVal source As System.Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
Dim DSN_PROD As System.Data.SqlClient.SqlConnection
' DSN_PROD = New System.Data.SqlClient.SqlConnection("myconnection")
DSN_PROD.Open()
' Build a sql statement string
Dim query1 As String = "Select PromoCode 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, DSN_PROD)
Dim PromoCode As Object
'Create new parameters for the sqlCommand object and initialize them to the input values.
Dim txtPromoCode As TextBox
Command1.Parameters.AddWithValue("@PromoCode", txtPromoCode.Text)
'Execute the command
PromoCode = Command1.ExecuteScalar
DSN_PROD.Close()
End Sub
</script>
<script language="JavaScript" type="text/javascript">
function RegTotal()
{
form = document.forms[0];
counter = 0;
form = document.forms[0];
counter = 0;
if ((form.txtNumberofTickets.value != "") || (form.txtNumberofTickets.value.length != 0)) {
counter = form.txtNumberofTickets.value
}
form.Regcount.value = counter;
form.Total.value = parseFloat(counter*25);
var obj = document.getElementById(hdnTotalId);
var obj1 = document.getElementById(Attendee_FNameId);
//obj.value below this line is what drives the second caculated total
obj.value = form.Total.value;
//obj1.value = form.Attendee_FName.value;
var obj = document.getElementById("ctl00_ctl00_cphPage_cphContent_SpecialControl_RSVPForm1_hdnTotal");
var obj1 = document.getElementById("ctl00_ctl00_cphPage_cphContent_SpecialControl_RSVPForm1_Attendee_FName");
//obj.value = form.Total.value;
//obj1.value = form.Attendee_FName.value;
var p = calcTotal(obj);
alert("Total Price = " + p);
function calcTotal(obj) {
var discount = 0;
if (GOLD20) {discount = .20}
var price = obj.value;
var savings = obj.value * discount;
var total = price - savings;
return form.Total.value;
}
}
</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="true" 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="510" 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="tbAttendee_FName" Text="First Name:"></asp:Label></td>
<td style="text-align: left; white-space: nowrap; height: 25px; width:25%">
<asp:TextBox ID="tbAttendee_FName" runat="server" Width="150px" MaxLength="150" ></asp:TextBox >
<asp:HiddenField ID="Attendee_FName" runat="server" Visible="true"/>
</td>
<td style="text-align: left; white-space: nowrap; height: 25px; width:5%">
<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="tbAttendee_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">
<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;"> </td>
<td style="text-align: right; white-space: nowrap; height: 25px;"> </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;"> <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;">
<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;">
<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;">
<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;">
<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;">
<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;"> </td>
<td style="text-align: right; white-space: nowrap; height: 25px;"> </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;"> <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>
<tr>
<td style="text-align: right; white-space: nowrap; height: 25px;">
<asp:Label ID="Label1" runat="server" Text="Number of Tickets:"></asp:Label> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;">
<input id="txtNumberofTickets" type="text" name="txtNumberofTickets" style="background-color:white; width:150px" onblur="RegTotal();" value="1" />
<asp:HiddenField ID="NumberofTickets" runat="server" Visible="true"/>
</td>
<td style="text-align: left; white-space: nowrap; height: 25px;"> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;"><input type="text" name="Regcount" size="2" style="background-color:#CCCCCC" readonly="readonly" /> </td>
</tr>
<!--Promo Coupon call starts here -->
<tr>
<td style="text-align: right; white-space: nowrap; height: 25px; background-color:#ededed">
<asp:Label ID="Label2" runat="server" Text="Check Discount Code:"></asp:Label> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;"><asp:TextBox ID="txtPromoCode" runat="server"></asp:TextBox></td>
<td style="text-align: left; white-space: nowrap; height: 25px;">
<!--custom validator to check server side and client side -->
<asp:CustomValidator ID="CVPromoCode" runat="server" OnServerValidate="CVPromoCode_ServerValidate" Text="Enter Your Promo!" ErrorMessage="Invalid Promo Code" ControlToValidate="txtPromoCode"></asp:CustomValidator>
</td>
<td style="text-align: left; white-space: nowrap; height: 25px;">
<asp:Button ID="btnSubmit" Runat=server Text="GO" Font-Size="11px" ></asp:Button>
</td>
</tr>
<tr>
<td style="text-align: right; white-space: nowrap; height: 25px;"><asp:Label ID="Label3" runat="server" Text="Amount of Discount:"></asp:Label> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;">
<asp:TextBox ID="txtDiscountValue" runat="server"></asp:TextBox> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;"> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;"> </td>
</tr>
<tr>
<td style="text-align: right; white-space: nowrap; height: 25px;">
<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;">
<input type="text" name="Total" size="23" value="" style="background-color:#FFFFBF;font-weight:bold;color:#FF0000;" readonly="readonly" disabled="disabled"/>
<!--location of hdnTotal field -->
<asp:TextBox ID="hdnTotal" Width="150px" runat="server" ReadOnly="true" Visible="true" ></asp:TextBox>
</td>
<td style="text-align: left; white-space: nowrap; height: 25px;"> </td> <td style="text-align: left; white-space: nowrap; height: 25px;"> </td>
</tr>
</table>
<p></p>
<hr />
      
</AdditionalFormControls>
<RSVPResponseText>
<font face="Arial, Helvetica, sans-serif">
Thanks for registering! Payment of $25.00 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>
<%@ Control Language="VB" ClassName="RSVP_PedBike_Promo_Test01" %>
<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
' Dim total As HiddenField
' Dim txtPromoCode As TextBox
'Dim txtDiscountValue As HiddenField
' Dim hdnTotal 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
'If txtPromoCode.Text.Length > 0 Then
'Dim Discount As Decimal = (totalBox * Integer.Parse(txtPromoCode.Text)) / 100
' txtDiscountValue.Value = txtDiscountValue.ToString
' total = total.Value - txtDiscountValue.Value
'End If
'txtDiscountValue.Value = total.ToString("$0.00")
'hdnTotal.Text = total.ToString("$0.00")
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")
' Dim Attendee_FName As HiddenField
'Request.Form("hdnTotal")
'hdnTotal = RSVPForm1.FindControl("hdnTotal")
'Attendee_FName = RSVPForm1.FindControl("Attendee_FName")
'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
' If Not (Attendee_FName Is Nothing) Then
'Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "Attendee_FNameIdScript", "var Attendee_FNameId = '" + Attendee_FName.ClientID + "';", True)
' End If
End Sub
Protected Sub ServerValidation(ByVal sender As Object, ByVal args As ServerValidateEventArgs)
Dim DSN_PROD As System.Data.SqlClient.SqlConnection
DSN_PROD = New System.Data.SqlClient.SqlConnection("myconnection")
DSN_PROD.Open()
' Build a sql statement string
Dim query1 As String = "Select PromoCode 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, DSN_PROD)
'Dim txtPromoCode As TextBox
Command1.Parameters.AddWithValue("@PromoCode", txtPromoCode.Text)
Dim PromoCode As Object
'Create new parameters for the sqlCommand object and initialize them to the input values.
'Execute the command
PromoCode = Command1.ExecuteScalar
DSN_PROD.Close()
End Sub
</script>
<script language="JavaScript" type="text/javascript">
function RegTotal()
{
form = document.forms[0];
counter = 0;
form = document.forms[0];
counter = 0;
if ((form.txtNumberofTickets.value != "") || (form.txtNumberofTickets.value.length != 0)) {
counter = form.txtNumberofTickets.value
}
form.Regcount.value = counter;
form.Total.value = parseFloat(counter*25);
var obj = document.getElementById(hdnTotalId);
var obj1 = document.getElementById(Attendee_FNameId);
//obj.value below this line is what drives the second caculated total
obj.value = form.Total.value;
//obj1.value = form.Attendee_FName.value;
var obj = document.getElementById("ctl00_ctl00_cphPage_cphContent_SpecialControl_RSVPForm1_hdnTotal");
var obj1 = document.getElementById("ctl00_ctl00_cphPage_cphContent_SpecialControl_RSVPForm1_Attendee_FName");
//obj.value = form.Total.value;
//obj1.value = form.Attendee_FName.value;
var p = calcTotal(obj);
alert("Total Price = " + p);
function calcTotal(obj) {
var discount = 0;
if (GOLD20) {discount = .20}
var price = obj.value;
var savings = obj.value * discount;
var total = price - savings;
return form.Total.value;
}
}
</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="true" 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="510" 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="tbAttendee_FName" Text="First Name:"></asp:Label></td>
<td style="text-align: left; white-space: nowrap; height: 25px; width:25%">
<asp:TextBox ID="tbAttendee_FName" runat="server" Width="150px" MaxLength="150" ></asp:TextBox >
<asp:HiddenField ID="Attendee_FName" runat="server" Visible="true"/>
</td>
<td style="text-align: left; white-space: nowrap; height: 25px; width:5%">
<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="tbAttendee_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">
<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;"> </td>
<td style="text-align: right; white-space: nowrap; height: 25px;"> </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;"> <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;">
<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;">
<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;">
<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;">
<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;">
<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;"> </td>
<td style="text-align: right; white-space: nowrap; height: 25px;"> </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;"> <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>
<tr>
<td style="text-align: right; white-space: nowrap; height: 25px;">
<asp:Label ID="Label1" runat="server" Text="Number of Tickets:"></asp:Label> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;">
<input id="txtNumberofTickets" type="text" name="txtNumberofTickets" style="background-color:white; width:150px" onblur="RegTotal();" value="1" />
<asp:HiddenField ID="NumberofTickets" runat="server" Visible="true"/>
</td>
<td style="text-align: left; white-space: nowrap; height: 25px;"> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;"><input type="text" name="Regcount" size="2" style="background-color:#CCCCCC" readonly="readonly" /> </td>
</tr>
<!--Promo Coupon call starts here -->
<tr>
<td style="text-align: right; white-space: nowrap; height: 25px; background-color:#ededed">
<asp:Label ID="Label2" runat="server" Text="Check Discount Code:"></asp:Label> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;">
<asp:textbox ID="txtPromoCode" runat="server"></asp:textbox></td>
<td style="text-align: left; white-space: nowrap; height: 25px;">
<!--custom validator to check server side and client side -->
<asp:CustomValidator ID="CVPromoCode" runat="server" OnServerValidate="CVPromoCode_ServerValidate" Text="Enter Your Promo!" ErrorMessage="Invalid Promo Code" ControlToValidate="txtPromoCode"></asp:CustomValidator>
</td>
<td style="text-align: left; white-space: nowrap; height: 25px;">
<asp:Button ID="btnSubmit" Runat=server Text="GO" Font-Size="11px" ></asp:Button>
</td>
</tr>
<tr>
<td style="text-align: right; white-space: nowrap; height: 25px;"><asp:Label ID="Label3" runat="server" Text="Amount of Discount:"></asp:Label> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;">
<asp:TextBox ID="txtDiscountValue" runat="server"></asp:TextBox> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;"> </td>
<td style="text-align: left; white-space: nowrap; height: 25px;"> </td>
</tr>
<tr>
<td style="text-align: right; white-space: nowrap; height: 25px;">
<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;">
<input type="text" name="Total" size="23" value="" style="background-color:#FFFFBF;font-weight:bold;color:#FF0000;" readonly="readonly" disabled="disabled"/>
<!--location of hdnTotal field -->
<asp:TextBox ID="hdnTotal" Width="150px" runat="server" ReadOnly="true" Visible="true" ></asp:TextBox>
</td>
<td style="text-align: left; white-space: nowrap; height: 25px;"> </td> <td style="text-align: left; white-space: nowrap; height: 25px;"> </td>
</tr>
</table>
<p></p>
<hr />
      
</AdditionalFormControls>
<RSVPResponseText>
<font face="Arial, Helvetica, sans-serif">
Thanks for registering! Payment of $25.00 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>
Would need to understand a but more of the requirements. Are you looking to adding different promocodes which are valid for a certain period of time? Should they be general or personal? Should they be generated randomly or named? Anything else you can think of? Setting up db and doing verification against it is trivial, it's the business process and logic that presents the challenge in my opinion.
/Carl.