input validation in asp.net cannot work - asp.net

I'm facing a problem in validation. I have done validation checking before user submit the button. Buy why the registration still can be added into database. Previously this page worked perfectly just after combining other pages with my team mate it cannot work :(
This is my Registration.aspx :
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="30%" valign="top">
<table width="100%">
<tr>
<td class="TableTitle">
Member Registration
</td>
</tr>
<tr>
<td>
<p>
Please enter your account information.</p>
<asp:ValidationSummary ID="RegUserValidationSummary" runat="server" CssClass="validation"
ValidationGroup="RegUserValidationGroup" />
</td>
</tr>
<tr>
<td class="PageContent">
<div>
<fieldset>
<legend>Account Information</legend>
<table width="100%">
<tr>
<td width="35%">
<asp:Label ID="lblUserName" runat="server" AssociatedControlID="txtUserName">Username:</asp:Label>
</td>
<td>
<asp:TextBox ID="txtUserName" runat="server" CssClass="textEntry" Width="130px"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="txtUserName"
CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required."
ValidationGroup="RegUserValidationGroup">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblPassword" runat="server" AssociatedControlID="txtPassword">Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="txtPassword" runat="server" CssClass="passwordEntry" TextMode="Password"
Width="130px"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="txtPassword"
CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required."
ValidationGroup="RegUserValidationGroup">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblConfirmPassword" runat="server" AssociatedControlID="txtConfirmPassword">Confirm Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="txtConfirmPassword" runat="server" CssClass="passwordEntry" TextMode="Password"
Width="130px"></asp:TextBox>
<asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="txtConfirmPassword"
CssClass="failureNotification" Display="Dynamic" ErrorMessage="Confirm Password is required."
ToolTip="Confirm Password is required." ValidationGroup="RegUserValidationGroup">*</asp:RequiredFieldValidator>
<asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="txtPassword"
ControlToValidate="txtConfirmPassword" CssClass="failureNotification" Display="Dynamic"
ErrorMessage="The Confirm Password must match the Password entry." ValidationGroup="RegUserValidationGroup">*</asp:CompareValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblSecQuestion1" runat="server" AssociatedControlID="ddlSecQuestion">Security Question:</asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlSecQuestion" runat="server" Width="250px">
<asp:ListItem>Where were you when you had your first kiss? </asp:ListItem>
<asp:ListItem>What was your dream job as a child? </asp:ListItem>
<asp:ListItem>What is the first name of the boy or girl that you first kissed?</asp:ListItem>
<asp:ListItem Value="•What is the middle name of your youngest child?">What is the middle name of your youngest child?</asp:ListItem>
<asp:ListItem>What is the name of your favourite pet?</asp:ListItem>
<asp:ListItem>In what city or town did your mother and father meet?</asp:ListItem>
<asp:ListItem>In what city or town was your first job?</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblSecAns" runat="server" AssociatedControlID="TxtSecAns">Security Answer:</asp:Label>
</td>
<td>
<asp:TextBox ID="TxtSecAns" runat="server" Width="130px"></asp:TextBox>
<asp:RequiredFieldValidator ID="SecAnsRequired" runat="server" ControlToValidate="TxtSecAns"
CssClass="failureNotification" ErrorMessage="Security Answer is required." ToolTip="Security Answer is required."
ValidationGroup="RegUserValidationGroup">*</asp:RequiredFieldValidator>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>Personal Information</legend>
<table width="100%">
<tr>
<td width="35%">
<asp:Label ID="lblName" runat="server" AssociatedControlID="txtName">Name:</asp:Label>
</td>
<td>
<asp:TextBox ID="txtName" runat="server" Width="130px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
CssClass="failureNotification" ErrorMessage="Name is required." ToolTip="Name is required."
ValidationGroup="RegUserValidationGroup">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblICNumber" runat="server" AssociatedControlID="txtICNumber">IC Number:</asp:Label>
</td>
<td>
<asp:TextBox ID="txtICNumber" runat="server" Width="130px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtICNumber"
CssClass="failureNotification" ErrorMessage="IC Number is required." ToolTip="IC Number is required."
ValidationGroup="RegUserValidationGroup">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtICNumber"
CssClass="failureNotification" ErrorMessage="Invalid Format of IC Number." ValidationExpression="\d{6}-\d{2}-\d{4}"
ValidationGroup="RegUserValidationGroup">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblEmail" runat="server" AssociatedControlID="txtEmail">Email:</asp:Label>
</td>
<td>
<asp:TextBox ID="txtEmail" runat="server" Width="130px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtEmail"
CssClass="failureNotification" ErrorMessage="Email is required." ToolTip="Email is required."
ValidationGroup="RegUserValidationGroup">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtEmail"
CssClass="failureNotification" ErrorMessage="Invalid Format of Email." ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"
ValidationGroup="RegUserValidationGroup">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblContactNumber" runat="server" AssociatedControlID="txtContactNumber">Contact Number:</asp:Label>
</td>
<td>
<asp:TextBox ID="txtContactNumber" runat="server" Width="130px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtContactNumber"
CssClass="failureNotification" ErrorMessage="Contact Number is required." ToolTip="Contact Number is required."
ValidationGroup="RegUserValidationGroup">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblAddress" runat="server" AssociatedControlID="txtAddress">Address:</asp:Label>
</td>
<td>
<asp:TextBox ID="txtAddress" runat="server" Width="160px" Height="60px" TextMode="MultiLine"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtAddress"
CssClass="failureNotification" ErrorMessage="Address is required." ToolTip="Address is required."
ValidationGroup="RegUserValidationGroup">*</asp:RequiredFieldValidator>
</td>
</tr>
</table>
</fieldset>
<p class="submitButton">
<asp:ImageButton ID="bthSubmit" runat="server" CommandName="Submit" ImageUrl="~/Forms/image/Button/Submit1.png"
ValidationGroup="RegUserValidationGroup" />
<asp:ImageButton ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ImageUrl="~/Forms/image/Button/cancel.png" />
</p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Content>
Here is my Registration.aspx.vb :
Imports System.Data.Common
Partial Class Forms_Account_Registration
Inherits System.Web.UI.Page
Private memberObj As New MemberObj
Private memberManager As New MemberManager
Protected Sub bthSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bthSubmit.Click
Dim oCommand As DbCommand = DbManager.GetCommandSP
Dim encryptor As New Encryption.Encryptor
Dim isDuplicateUser As Boolean
Dim isDuplicateIC As Boolean
Try
If memberManager.CheckDuplicateUser(oCommand, (txtUserName.Text.Trim).ToLower) = False Then
isDuplicateUser = False
Else
isDuplicateUser = True
End If
If isDuplicateUser = False Then
If memberManager.CheckDuplicateUserIC(oCommand, (txtICNumber.Text.Trim)) = False Then
isDuplicateIC = False
Else
isDuplicateIC = True
lblErrorMsg.Text = "Sorry,This IC number has been registered. An IC number can use to create ONE account only."
myDiv.Visible = True
End If
Else
isDuplicateIC = True
lblErrorMsg.Text = "Sorry, this username is already in use. Please choose other username."
myDiv.Visible = True
End If
Catch ex As Exception
Manager.LogManager.WriteLine(ex)
Response.Redirect("../500 Internal Server Error.aspx")
End Try
If isDuplicateIC = False Then
memberObj.UserName = txtUserName.Text.Trim.ToLower
memberObj.Password = encryptor.Encrypt(txtPassword.Text.Trim)
memberObj.SecurityQuestion = ddlSecQuestion.SelectedValue
memberObj.SecurityAnswer = TxtSecAns.Text
memberObj.MemberName = txtName.Text
memberObj.MemberIC = txtICNumber.Text
memberObj.MemberEmail = txtEmail.Text
memberObj.ContactNo = txtContactNumber.Text
memberObj.MemberAddress = txtAddress.Text
memberObj.MemberStatus = "UNBLOCK"
memberObj.isAllowedForum = "Y"
memberObj.CreatedDate = Today.Date
memberManager.Insert(oCommand, memberObj)
lblErrorMsg.Text = ""
myDiv.Visible = False
lblSuccessMsg.Text = "You have been successfully registered."
myDivSuccess.Visible = True
End If
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
lblErrorMsg.Text = ""
myDiv.Visible = False
lblSuccessMsg.Text = ""
myDivSuccess.Visible = False
End If
End Sub
End Class

Related

RequiredFieldValidator for dropdownlist not work

what I do wrong?
<asp:Panel ID="pnlProductUnits" runat="server" Width="100%">
<asp:Repeater ID="repProductUnits" runat="server" EnableViewState="true" onitemcommand="Button_ItemCommand">
<HeaderTemplate>
<table class="grid" width="100%">
<tbody>
<tr>
<th align="left">test1</th>
<th align="left">test2</th>
<th align="left">test3</th>
<th width="50"></th>
</tr>
</tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%# ((DBData.Catalog.ProductU)Container.DataItem).PrimaryUnitName%>
</td>
<td align="center">
<%# ((DBData.Catalog.ProductU)Container.DataItem).SecondaryUnitName%>
</td>
<td align="center">
<%# ((DBData.Catalog.ProductU)Container.DataItem).Quantity%>
</td>
<td style="display:none">
<asp:Label ID="PrimaryUnitID" runat="server"
Text="<%# ((DBData.Catalog.ProductU)Container.DataItem).PrimaryUnitID%>">
</asp:Label>
<asp:Label ID="SecondaryUnitID" runat="server"
Text="<%# ((DBData.Catalog.ProductU)Container.DataItem).SecondaryUnitID%>">
</asp:Label>
</td>
<td align="center">
<asp:Button id="btRemove" runat="server" commandname="deleteProductUnit" Text="Delete">
</asp:Button>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
<tr>
<td>
<asp:DropDownList ID="ddlPrimaryUnit" runat="server" ValidationGroup="grpQuantity">
</asp:DropDownList>
<asp:RequiredFieldValidator runat="server" ErrorMessage="*"
Display="Dynamic" Text="*" ControlToValidate="ddlPrimaryUnit" ValidationGroup="grpQuantity" ForeColor="#FF3300">
</asp:RequiredFieldValidator>
</td>
<td>
<asp:DropDownList ID="ddlSecondaryUnit" runat="server" ValidationGroup="grpQuantity">
</asp:DropDownList>
<asp:RequiredFieldValidator runat="server" ErrorMessage="*" Display="Dynamic" Text="*" ControlToValidate="ddlSecondaryUnit" ValidationGroup="grpQuantity" ForeColor="#FF3300"></asp:RequiredFieldValidator>
</td>
<td>
<asp:TextBox ID="txtQuantity" runat="server" placeholder="select value" ClientIDMode="Static"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ErrorMessage="*" ControlToValidate="txtQuantity" ValidationGroup="grpQuantity" ForeColor="#FF3300"></asp:RequiredFieldValidator>
</td>
<td colspan="20">
<asp:Button id="btNew" runat="server" commandname="addProductUnit" Text="Add"
CommandArgument="test" ValidationGroup="grpQuantity"> </asp:Button>
</td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>
</asp:Panel>
I suspect your problem is related to the validator knowing what the DropDownList's original selection was and whether or not something has been selected. You may need to add an InitialValue to the required field validator.
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server" ErrorMessage="*" Display="Dynamic" Text="*"
ControlToValidate="ddlSecondaryUnit" ValidationGroup="grpQuantity"
ForeColor="#FF3300" InitialValue=""></asp:RequiredFieldValidator>
Depending on your DropDownList's datasource, that value may be something like "Please Select" or maybe just blank.

Get the input from a form to display in textbox in the same web page

My form collecting input.
<table>
<tr>
<td>First Name:</td>
<td><asp:TextBox ID="txtFirstName" runat="server">
</asp:TextBox>
</td>
<td class="style2"><asp:RequiredFieldValidator ID="rfvFirstName"
runat="server"
ControlToValidate="txtFirstName"
ErrorMessage="First Name can't be left blank"
SetFocusOnError="True">*
</asp:RequiredFieldValidator>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Business</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>Last Name:</td>
<td><asp:TextBox ID="txtLastName" runat="server">
</asp:TextBox></td>
<td class="style2"><asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtLastName"
ErrorMessage="Last Name can't be left blank"
SetFocusOnError="True">*
</asp:RequiredFieldValidator>
</td></tr>
<tr><td>UserName:</td>
<td><asp:TextBox ID="txtUserName" runat="server">
</asp:TextBox>
</td>
<td class="style2"><asp:RequiredFieldValidator
ID="rfvUserName"
runat="server"
ControlToValidate="txtUserName"
ErrorMessage="UserName can't be left blank"
SetFocusOnError="True">*
</asp:RequiredFieldValidator>
</td></tr>
<tr><td>Password:</td>
<td><asp:TextBox ID="txtPwd" runat="server"
TextMode="Password">
</asp:TextBox>
</td>
<td class="style2"><asp:RequiredFieldValidator ID="rfvPwd"
runat="server" ControlToValidate="txtPwd"
ErrorMessage="Password can't be left blank"
SetFocusOnError="True">*
</asp:RequiredFieldValidator>
</td></tr>
<tr><td>Confirm Password:</td>
<td><asp:TextBox ID="txtRePwd" runat="server"
TextMode="Password">
</asp:TextBox>
</td>
<td class="style2"><asp:CompareValidator ID="CompareValidator1"
runat="server"
ControlToCompare="txtRePwd"
ControlToValidate="txtPwd"
Operator="Equal"
ErrorMessage="Password and confirm password do not match"
SetFocusOnError="True">
</asp:CompareValidator>
</td></tr>
<tr><td class="style1">Gender:</td>
<td class="style1"><asp:RadioButtonList ID="rdoGender"
runat="server">
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
</asp:RadioButtonList>
</td>
<td class="style3"><asp:RequiredFieldValidator
ID="RequiredFieldValidator2"
runat="server"
ControlToValidate="rdoGender"
ErrorMessage="Gender can't be left blank"
SetFocusOnError="True">*
</asp:RequiredFieldValidator>
</td></tr>
<tr><td>Address:</td>
<td><asp:TextBox ID="txtAdress" runat="server"
TextMode="MultiLine">
</asp:TextBox>
</td>
<td class="style2"><asp:RequiredFieldValidator ID="rfvAddress"
runat="server"
ControlToValidate="txtAdress"
ErrorMessage="Address can't be left blank"
SetFocusOnError="True">*
</asp:RequiredFieldValidator>
</td></tr>
<tr><td>Email ID:</td>
<td><asp:TextBox ID="txtEmailID" runat="server">
</asp:TextBox>
</td>
<td class="style2"><asp:RequiredFieldValidator
ID="RequiredFieldValidator3"
runat="server"
ControlToValidate="txtEmailID"
ErrorMessage="Email can't be left blank"
SetFocusOnError="True">*
</asp:RequiredFieldValidator>
</td></tr>
<tr><td><asp:Label ID="lblMsg" runat="server">
</asp:Label>
</td>
<td><asp:ValidationSummary ID="ValidationSummary1"
runat="server" ShowMessageBox="True"
ShowSummary="False"/>
</td></tr>
<tr><td><asp:Button ID="btnSave" runat="server"
Text="Sign Up"
onclick="btnSave_Click"/>
</td></tr>
</table>
I know this is set up for a server which I will work on next,
right now I am just trying to get the btnsave button to display the input from the form into a plain textbox.
How is this done?
To do that on the code behind just use the Request.Form, contains all the form data in one line.
So your final code will be something like txtLiteral.Text = Request.Form.ToString()

2 asp panel controls in an update panel

I kept 2 asp panel controls (with text boxes and buttons) in an update panel so that i want only 1 to be displayed at a time. And when i click on the button, the next asp panel should be visible with old asp panel hidden. I am not able to figure it out.. Here is the code...
<asp:UpdatePanel ID="updatepnlSSN" ChildrenAsTriggers="false" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="pnlSSNLookup" runat="server" BackColor="#EEE6DF" BorderColor="#274F73"
BorderStyle="Outset">
<table>
<tr>
<td colspan="3">
<asp:Label ID="lblMsg" runat="server" ForeColor="#713C2C"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblStudentID" runat="server" Text="State Student ID:" ForeColor="#274F73" ToolTip="State Student ID Label"></asp:Label>
</td
<td>
<asp:TextBox ID="txtStudentID" runat="server" ToolTip="Enter the student's state ID number" AccessKey="i" TabIndex="1"></asp:TextBox>
</td>
<td>
<asp:RegularExpressionValidator ID="valStudentID" runat="server" ControlToValidate="txtStudentID" ErrorMessage="Please enter numeric only" ValidationExpression="[0-9]+" ForeColor="#713C2C" Display="Dynamic">
</asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="valStdntID" runat="server" ControlToValidate="txtStudentID" Display="Dynamic" ErrorMessage="Please enter a State Student ID" ForeColor="#713C2C"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblFName" runat="server" Text="Student Legal First Name:" ForeColor="#274F73" ToolTip="First Name Label"></asp:Label>
<td>
<td>
<asp:TextBox ID="txtFName" runat="server" AccessKey="f" TabIndex="2" ToolTip="Enter the Student's First Name"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="valFirstName" runat="server" ControlToValidate="txtFName" Display="Dynamic" ErrorMessage="Please enter the student's first name." ForeColor="#713C2C"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDOB" runat="server" ForeColor="#274F73" Text="Student Date of Birth </br> (mm/dd/yyyy)" ToolTip="STudent's date of birth label"></asp:Label>
</td>
<td>
<div style="position: relative;">
<asp:TextBox ID="txtDOB" runat="server" AccessKey="d" TabIndex="3" ToolTip="Enter the student's date of birth"></asp:TextBox>
<cc1:CalendarExtender ID="txtDOB_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtDOB" PopupPosition="Right" Format="MM/dd/yyyy">
</cc1:CalendarExtender>
</div>
</td>
<td>
<asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtDOB" ErrorMessage="Please enter a valid date: mm/dd/yyyy" ForeColor="#713C2C" MaximumValue="01/01/2075" MinimumValue="01/01/1970" Type="Date" Display="Dynamic"></asp:RangeValidator>
<asp:RequiredFieldValidator ID="valStudentDOB" runat="server" ControlToValidate="txtDOB" Display="Dynamic" ErrorMessage="Please enter the student's date of birth" ForeColor="#713C2C"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnSearchSSN" runat="server" Text="Search" AccessKey="s" TabIndex="4" ToolTip="Begin student search" />
</td>
</tr>
</table>
</asp:Panel>
</td> </tr>
<tr>
<td>
</td>
</tr>
<tr>
<td style="padding: 0 10px 0 10px">
<asp:Panel ID="pnlSSNEntry" runat="server" BackColor="#EEE6DF" BorderColor="#274F73" BorderStyle="Outset" Visible="False" Height="110px">
<table align="left">
<tr>
<td colspan="3">
<asp:Label ID="lblSSnText" runat="server" ForeColor="#274F73" Text="Please enter the SSN for: "></asp:Label>
<asp:Label ID="lblSSNName" runat="server" ForeColor="#274F73"></asp:Label>
</td>
</tr>
<tr>
<td colspan="3">
<asp:Label ID="lblSSNSubmitMsg" runat="server" ForeColor="#713C2C"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblSSN0" runat="server" ForeColor="#274F73" Text="Social Security Number: "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtArea" runat="server" AccessKey="a" MaxLength="3" TabIndex="5" ToolTip="Enter the student's SSN area number" Width="29px"></asp:TextBox>
<asp:TextBox ID="txtGroup" runat="server" AccessKey="g" MaxLength="2" TabIndex="6" ToolTip="Enter the student's SSN group number" Width="22px"></asp:TextBox>
<asp:TextBox ID="txtSerial" runat="server" AccessKey="r" MaxLength="4" TabIndex="7" ToolTip="Enter the student's SSN serial number" Width="35px"></asp:TextBox>
</td>
<td>
<asp:Label ID="lblSSNError" runat="server" ForeColor="#713C2C" Text="Please enter a valid Social Security Number" Visible="False"></asp:Label>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnSSN" runat="server" Text="Submit SSN" AccessKey="n" TabIndex="8" ToolTip="Submit the student's SSN" />
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSearchSSN" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="btnSSN" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
Would you not be better using an ASP:MultiView. Then you show one view at a time and it come with mutually exclusive bindings associated with it.
<asp:MultiView>
<asp:View>
View 1
</asp:View>
<asp:View>
View 2
</asp:View>
</asp:MultiView>
You would be better off using MultiView inside UpdatePanel and setting ActiveView based on button click. Here's a tutorial
In short MultiView is a wrapper around panels. It contains collection of View objects that can be activated. Only one View can be visible at any given time.
Answers above suggested an excellent approach to solve above issue, but if you really want to do that than try adding code on button click events like
protected void btnSearchSSN_Click(object sender, EventArgs e)
{
pnlSSNLookup.Visible = false;
this.pnlSSNEntry.Visible = true;
}
protected void btnSSN_Click(object sender, EventArgs e)
{
pnlSSNEntry.Visible = false;
this.pnlSSNLookup.Visible = true;
}
Hopefully it will give you required result you looking for.

CSS compatibility with different browsers

I have an Asp.Net create user wizard and trying to modify and arrange its labels to look same in every browser.
Now the problem is it looks fine in chrome but it looks same in IE9 and Firefox.
This is how it looks in chrome:
When I get into inspect here it shows the element .style property on the right which has two elements ie position:absolute and Z-index:2 which makes everything scrap.
Here come the problem with IE and firefox:
When it comes to firefox and IE it neglects everything:
I have give the below properties in my css file as shown below but this works only for chrome so I would like to know how would I change it for IE and as well as Firefox
.signtbl
{
z-index:2;
position:relative !important;
}
This is my entire code for my control:
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server"
DisableCreatedUser="True" MailDefinition-BodyFileName="~/EmailTemplates/NewAccountTemplate.htm" MailDefinition-From="noreply#imgaid.com" LoginCreatedUser="False" MailDefinition-IsBodyHtml="True" MailDefinition-Priority="High" MailDefinition-Subject="Pending Activation">
<ContinueButtonStyle BorderStyle="None" CssClass="btn big" Font-Size="12px"/>
<CreateUserButtonStyle CssClass="btn big" Height="30px"
Width="125px" BorderStyle="None" Font-Size="12px" />
<MailDefinition BodyFileName="~/EmailTemplates/NewAccountTemplate.htm"
From="noreply#xyz.com" IsBodyHtml="True" Priority="High"
Subject="Pending Activation">
</MailDefinition>
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
<ContentTemplate>
<table>
<tr>
<td align="right">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" CssClass="signtbl">User Name:</asp:Label>
</td>
<td>
<asp:TextBox ID="UserName" runat="server" BorderStyle="Solid" BorderWidth="1px" BorderColor="#0099CC" BackColor="#FAFFBD" AutoCompleteType="Disabled"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server"
ControlToValidate="UserName" ErrorMessage="User Name is required."
ToolTip="User Name is required." ValidationGroup="CreateUserWizard1"
CssClass="signupvalidators" ForeColor="Red">*</asp:RequiredFieldValidator>
<div id="divUsernameAvailability" runat="server"></div>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" CssClass="signtbl">Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="Password" runat="server" TextMode="Password" BorderStyle="Solid" BorderWidth="1px" BorderColor="#0099CC" BackColor="#FAFFBD"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server"
ControlToValidate="Password" ErrorMessage="Password is required."
ToolTip="Password is required." ValidationGroup="CreateUserWizard1"
CssClass="signupvalidators" ForeColor="Red">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="ConfirmPasswordLabel" runat="server"
AssociatedControlID="ConfirmPassword" CssClass="signtbl">Confirm Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" BorderStyle="Solid" BorderWidth="1px" BorderColor="#0099CC" BackColor="#FAFFBD"></asp:TextBox>
<asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server"
ControlToValidate="ConfirmPassword"
ErrorMessage="Confirm Password is required."
ToolTip="Confirm Password is required."
ValidationGroup="CreateUserWizard1" CssClass="signupvalidators" ForeColor="Red">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email" CssClass="signtbl">E-mail:</asp:Label>
</td>
<td>
<asp:TextBox ID="Email" runat="server" BorderStyle="Solid" BorderWidth="1px" BorderColor="#0099CC" BackColor="#FAFFBD"></asp:TextBox>
<asp:RequiredFieldValidator ID="EmailRequired" runat="server"
ControlToValidate="Email" ErrorMessage="E-mail is required."
ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1"
CssClass="signupvalidators" ForeColor="Red">*</asp:RequiredFieldValidator>
<div id="divEmailAvailability" runat="server"></div>
</td>
</tr>
<%--<tr>
<td align="right">
<asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question" CssClass="signtbl">Security Question:</asp:Label>
</td>
<td>
<asp:TextBox ID="Question" runat="server" BorderStyle="Solid" BorderWidth="1px" BorderColor="#0099CC" BackColor="#FAFFBD"></asp:TextBox>
<asp:RequiredFieldValidator ID="QuestionRequired" runat="server"
ControlToValidate="Question" ErrorMessage="Security question is required."
ToolTip="Security question is required."
ValidationGroup="CreateUserWizard1" CssClass="signupvalidators" ForeColor="Red">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer" CssClass="signtbl">Security Answer:</asp:Label>
</td>
<td>
<asp:TextBox ID="Answer" runat="server" BorderStyle="Solid" BorderWidth="1px" BorderColor="#0099CC" BackColor="#FAFFBD"></asp:TextBox>
<asp:RequiredFieldValidator ID="AnswerRequired" runat="server"
ControlToValidate="Answer" ErrorMessage="Security answer is required."
ToolTip="Security answer is required." ValidationGroup="CreateUserWizard1"
CssClass="signupvalidators" ForeColor="Red">*</asp:RequiredFieldValidator>
</td>
</tr>--%>
<tr>
<td align="center" colspan="2">
<asp:RegularExpressionValidator ID="UsernameLength" runat="server"
ErrorMessage="Username should be minimum 5-10 characters."
ControlToValidate="UserName" Display="Dynamic" ForeColor="Red"
ValidationExpression="^[\s\S]{5,10}$" ValidationGroup="CreateUserWizard1"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:CompareValidator ID="PasswordCompare" runat="server"
ControlToCompare="Password" ControlToValidate="ConfirmPassword"
Display="Dynamic"
ErrorMessage="The Password and Confirmation Password must match."
ValidationGroup="CreateUserWizard1" ForeColor="Red"></asp:CompareValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color:Red;">
<asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:RegularExpressionValidator ID="PasswordLength" runat="server" Display="Dynamic"
ErrorMessage="Password length minimum: 7. Non-alphanumeric characters required: 1"
ControlToValidate="Password" ValidationExpression="(?=^.{7,51}$)([A-Za-z]{1})([A-Za-z0-9!##$%_\^\&\*\-\.\?]{5,49})$"
ForeColor="Red" ValidationGroup="CreateUserWizard1"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:RegularExpressionValidator ID="EmailValidator" runat="server" Display="Dynamic"
ControlToValidate="Email" ErrorMessage="Please enter a valid e-mail address." ValidationExpression="^[\w-]+(\.[\w-]+)*#([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$" ForeColor="Red" ValidationGroup="CreateUserWizard1"></asp:RegularExpressionValidator>
</td>
</tr>
</table>
<%-- <asp:UpdateProgress ID="UpdateProgressUserDetails" runat="server" DisplayAfter="0">
<ProgressTemplate>
<div style="position: absolute; top: 215px; left:140px;">
<img src="img/Loader.gif" alt="loading" /><br />
</div>
</ProgressTemplate>
</asp:UpdateProgress>--%>
</ContentTemplate>
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
<ContentTemplate>
<table>
<tr>
<td align="center" colspan="2">
Complete</td>
</tr>
<tr>
<td>
Your account has been successfully created.</td>
</tr>
<%--<tr>
<td align="right" colspan="2">
<asp:Button ID="ContinueButton" runat="server" BorderStyle="None"
CausesValidation="False" CommandName="Continue" CssClass="btn big"
Font-Size="12px" Text="Continue" ValidationGroup="CreateUserWizard1" />
</td>
</tr>--%>
</table>
</ContentTemplate>
</asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
why dont you try using tables to align your controls in grid structure that might often help.
here's what you can do.Create a div where you want to place your controls
within the div first create a tabular structure then place control in individual
try may be this could help

In asp:CreateUserWizard a DropDownList won't save to db?

In the 2nd step of the wizard, I have a dropdownlist that is populated from the db. when I go to the 3rd step RegisterUser.ActiveStepChanged event if fired. In there I save the data to the db. My textboxes are saving properly but my the vb code isn't pulling the selectedIndex/Value from the dropdown.
I tried populating the dropdown in Load, PreRender and neither of them helped. I also did if not Postback which didn't help either.
Any ideas?
Here is the code Sample:
Thanks.
Asp.net - It only includes relevant code:
<%# Page Title="Register" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
CodeBehind="Register.aspx.vb" Inherits="Events.Register" EnableEventValidation="false" Trace="true" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script type="text/javascript" src="../Scripts/CommonScripts.js">
</script>
<style type="text/css">
.textInput {
width: 150px;
}
.dropdownField
{
width: 155px;
}
</style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:CreateUserWizard ID="RegisterUser" runat="server" EnableViewState="False"
Height="68px" Width="70%" >
<FinishNavigationTemplate>
<table cellpadding="5px" width="100%">
<tr>
<td align="center" width="50%">
<asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete"
Text="Finish" onclick="RegisterUser_ActiveStepChanged" /></td>
</tr>
</table>
</FinishNavigationTemplate>
<LayoutTemplate>
<asp:PlaceHolder ID="wizardStepPlaceholder" runat="server"></asp:PlaceHolder>
<asp:PlaceHolder ID="navigationPlaceholder" runat="server"></asp:PlaceHolder>
</LayoutTemplate>
<WizardSteps>
<asp:CreateUserWizardStep ID="RegisterUserWizardStep" runat="server">
<ContentTemplate>
<table style="font-size:100%;height:100%;width:100%;">
<tr>
<td align="center" colspan="2">
Sign Up for Your New Account</td>
</tr>
<tr>
<td align="right" style="width:40%">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
</td>
<td>
<asp:TextBox ID="UserName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server"
ControlToValidate="UserName" ErrorMessage="User Name is required."
ToolTip="User Name is required." ValidationGroup="RegisterUser">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server"
ControlToValidate="Password" ErrorMessage="Password is required."
ToolTip="Password is required." ValidationGroup="RegisterUser">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="ConfirmPasswordLabel" runat="server"
AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server"
ControlToValidate="ConfirmPassword"
ErrorMessage="Confirm Password is required."
ToolTip="Confirm Password is required." ValidationGroup="RegisterUser">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
</td>
<td>
<asp:TextBox ID="Email" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="EmailRequired" runat="server"
ControlToValidate="Email" ErrorMessage="E-mail is required."
ToolTip="E-mail is required." ValidationGroup="RegisterUser">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label>
</td>
<td>
<asp:TextBox ID="Question" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="QuestionRequired" runat="server"
ControlToValidate="Question" ErrorMessage="Security question is required."
ToolTip="Security question is required." ValidationGroup="RegisterUser">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label>
</td>
<td>
<asp:TextBox ID="Answer" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="AnswerRequired" runat="server"
ControlToValidate="Answer" ErrorMessage="Security answer is required."
ToolTip="Security answer is required." ValidationGroup="RegisterUser">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:CompareValidator ID="PasswordCompare" runat="server"
ControlToCompare="Password" ControlToValidate="ConfirmPassword"
Display="Dynamic"
ErrorMessage="The Password and Confirmation Password must match."
ValidationGroup="RegisterUser"></asp:CompareValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color:Red;">
<asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
</table>
</ContentTemplate>
<CustomNavigationTemplate>
<table border="0" cellspacing="5" style="width:100%;height:100%;">
<tr align="right">
<td align="center" colspan="0">
<asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext"
Text="Create User" ValidationGroup="RegisterUser" />
</td>
</tr>
</table>
</CustomNavigationTemplate>
</asp:CreateUserWizardStep>
<asp:WizardStep runat="server" Title="General Information" StepType="Finish"
ID="GeneralInfo">
<table style="font-size:100%; width:100%; height:100%">
<tr>
<td align="center" colspan="2">
Please Add Additional Account Information</td>
</tr>
<td align="right">
Birthday:
</td>
<td>
<asp:TextBox class="textInput" ID="Birthday" runat="server"></asp:TextBox>
<asp:ImageButton ID="BirthdayButton" runat="server" ImageUrl="~/Images/Calendar.png" Height="24" Width="24" ImageAlign="Baseline" />
<asp:CalendarExtender TargetControlID="Birthday" ID="BirthdayExtender" runat="server" PopupButtonID="BirthdayButton" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="Birthday" ErrorMessage="Birthday is required."
ToolTip="Birthday is required." ValidationGroup="RegisterUser">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
Religious Observance:
</td>
<td>
<asp:DropDownList class="dropdownField" ID="ReligiousObservance" runat="server"
DataSourceID="HashkafaDataSource" DataTextField="chvDescription"
DataValueField="intReligiousMasterID" AppendDataBoundItems="true" >
<asp:ListItem Value="0">Select One</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="HashkafaDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:EventsDB.06-ConnectionString %>"
SelectCommand="select s.chvSiteName, r.intReligiousMasterID, r.chvDescription from
tblSiteMaster as s inner join tblSiteReligious as sr on s.intSiteID=sr.intSiteID
inner join tblReligiousMaster as r on r.intReligiousMasterID=sr.intReligiousMasterID
where s.intSiteID=cast(#SiteID As int)">
<SelectParameters>
<asp:Parameter Name="SiteID"/>
</SelectParameters>
</asp:SqlDataSource>
<asp:RequiredFieldValidator ID="ReligiousObservanceRequired" runat="server"
ControlToValidate="ReligiousObservance" ErrorMessage="Religious Observance is required."
ToolTip="Religious Observance is required." ValidationGroup="RegisterUser">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color:Red;">
<asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
</table>
<%-- <CustomNavigationTemplate/> --%>
</asp:WizardStep>
<asp:CompleteWizardStep runat="server">
<ContentTemplate>
<table style="font-size:100%;height:68px;width:70%;">
<tr>
<td>
Your account has been successfully created.</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:Button ID="ContinueButton" runat="server" CausesValidation="False"
CommandName="Continue" Text="Continue" ValidationGroup="RegisterUser" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:CompleteWizardStep>
</WizardSteps>
<StartNavigationTemplate>
hello<br />
</StartNavigationTemplate>
<StepNavigationTemplate>
<table cellpadding="5px" width="100%">
<tr>
<td align="right"><asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False"
CommandName="MovePrevious" Text="Previous" /> </td>
<td align="left"> <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext"
Text="Next" Height="20" Width="18" /> </td> </tr>
</table>
</StepNavigationTemplate>
</asp:CreateUserWizard>
</asp:Content>
VB.net code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'If (Not IsPostBack) Then
' PopulateReligiousDropdown()
'End If
'Scripts for state and country drop down
' Commented out because doing in ASP.Net
' Page.ClientScript.RegisterStartupScript(Me.GetType(), _
' "MyScript", _
' "window.onload=init();" & _
' "function init() { " & _
' "fillList(document.getElementById('MainContent_RegisterUser_dropCountry'), areas[5]);" & _
' "fillList(document.getElementById('MainContent_RegisterUser_dropState'), areas[0]);" & _
'" }", True)
PhotoUploadValidator.ValidationExpression = HelperMethods.regexPhotos.ToString()
RegisterUser.ContinueDestinationPageUrl = Request.QueryString("ReturnUrl")
' Populate ReligiousDropdown
HelperMethods.SiteID = HelperMethods.GetSiteID("Request.Url.Host")
HashkafaDataSource.SelectParameters.Item(0).DefaultValue = HelperMethods.SiteID
End Sub
Protected Sub RegisterUser_ActiveStepChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RegisterUser.ActiveStepChanged
' Have we JUST reached the Complete step?
If RegisterUser.ActiveStep.Title = "General Information" Then
'PopulateReligiousDropdown()
End If
If RegisterUser.ActiveStep.Title = "Complete" Then
Dim GeneralInfo As WizardStep = CType(RegisterUser.FindControl("GeneralInfo"), WizardStep)
' Programmatically reference the TextBox controls
Dim LastName As TextBox = CType(GeneralInfo.FindControl("LastName"), TextBox)
Dim FirstName As TextBox = CType(GeneralInfo.FindControl("FirstName"), TextBox)
Dim dropCountry As DropDownList = CType(GeneralInfo.FindControl("dropCountry"), DropDownList)
Dim dropState As DropDownList = CType(GeneralInfo.FindControl("dropState"), DropDownList)
Dim City As TextBox = CType(GeneralInfo.FindControl("City"), TextBox)
Dim ZipCode As TextBox = CType(GeneralInfo.FindControl("ZipCode"), TextBox)
Dim Address As TextBox = CType(GeneralInfo.FindControl("Address"), TextBox)
Dim Phone As TextBox = CType(GeneralInfo.FindControl("Phone"), TextBox)
Dim Birthday As TextBox = CType(GeneralInfo.FindControl("Birthday"), TextBox)
Dim ReligiousObservance As DropDownList = CType(GeneralInfo.FindControl("ReligiousObservance"), DropDownList)
' Dim PhotoUpload As TextBox = CType(GeneralInfo.FindControl("PhotoUpload"), TextBox)
' Update the UserProfiles record for this user
' Get the UserId of the just-added user
Dim newUser As MembershipUser = Membership.GetUser
Dim newUserId As Guid = CType(newUser.ProviderUserKey, Guid)
' Insert a new record into UserProfiles
Dim connectionString As String = ConfigurationManager.ConnectionStrings("EventsDB.06-ConnectionString").ConnectionString
Dim updateSql As String = "Insert into tblUsers " & _
"Values (#UserId, GETDATE(), #FirstName, #LastName, #dropCountry, #dropState, #City, #ZipCode, #Address, #Phone, #Birthday, #ReligiousObservance)"
Using myConnection As New SqlConnection(connectionString)
myConnection.Open()
Dim myCommand As New SqlCommand(updateSql, myConnection)
myCommand.Parameters.AddWithValue("#UserId", newUserId)
myCommand.Parameters.AddWithValue("#LastName", LastName.Text.Trim())
myCommand.Parameters.AddWithValue("#FirstName", FirstName.Text.Trim())
myCommand.Parameters.AddWithValue("#dropCountry", dropCountry.SelectedValue)
myCommand.Parameters.AddWithValue("#dropState", dropState.SelectedValue)
myCommand.Parameters.AddWithValue("#City", City.Text.Trim())
myCommand.Parameters.AddWithValue("#ZipCode", ZipCode.Text.Trim())
myCommand.Parameters.AddWithValue("#Address", Address.Text.Trim())
myCommand.Parameters.AddWithValue("#Phone", Phone.Text.Trim())
myCommand.Parameters.AddWithValue("#Birthday", Birthday.Text.Trim())
myCommand.Parameters.AddWithValue("#ReligiousObservance", ReligiousObservance.SelectedIndex)
'The dropdown's are not populating the server. The Value isn't being passed
' and I don't know why?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
myCommand.ExecuteNonQuery()
myConnection.Close()
End Using
End If
End Sub

Resources