EDN Admin
Well-known member
I am writing a small aspx web application that takes in forum information after validation and then opens a database connection and populates the proper columns with data.
My issue is that even with: Import Namespace="System.Data.OleDb" on the page I am getting:
<span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif Type OledbConnetion is not defined. I am extremly new to VB, I am coming from java and honestly I do not have all year to read vb code and take classes and read books. I need to finish
this app for a client so I am kind of rushed.
<span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif Any ways the code is as follows:
<span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; Sub validationComplete(sender <span style="color:Blue; As <span style="color:Blue; Object, e <span style="color:Blue; As EventArgs)
<span style="color:Blue; if Page.IsValid <span style="color:Blue; then
<span style="color:Blue; Dim strConnection <span style="color:Blue; as <span style="color:Blue; String = <span style="color:#A31515; "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnection += <span style="color:#A31515; "Data Source=Contacts.sdf"
<span style="color:Blue; Dim connection <span style="color:Blue; as <span style="color:Blue; new OledbConnetion(strConnection)
connetion.Open()
<span style="color:Blue; else
<span style="color:Blue; end <span style="color:Blue; If
<span style="color:Blue; end <span style="color:Blue; sub
[/code]
<br/>
Help is appreciated!
Also for those interested the page ode is bellow - if you could maybe give me tips on how to take the data entered from the forum and insert it into the table for the database that would be awesome. things I need to check for:
If male or female is selected M or F needs to be inserted and if news letter is selected N needs to be inserted into the database.
<div style="color:Black;background-color:White; <pre>
<span style="background-color:Yellow; <%<span style="color:Blue; @ <span style="color:#A31515; Page <span style="color:Red; Language<span style="color:Blue; =<span style="color:Blue; "VB" <span style="color:Red; Debug<span style="color:Blue; =<span style="color:Blue; "true" <span style="color:Red; AutoEventWireUp<span style="color:Blue; =<span style="color:Blue; "True"<span style="background-color:Yellow; %>
<span style="background-color:Yellow; <%<span style="color:Blue; @ <span style="color:#A31515; Import <span style="color:Red; Namespace<span style="color:Blue; =<span style="color:Blue; "System.Data.OleDb" <span style="background-color:Yellow; %>
<span style="background-color:Yellow; <%<span style="color:Blue; @ <span style="color:#A31515; Import <span style="color:Red; Namespace<span style="color:Blue; =<span style="color:Blue; "System.Text.RegularExpressions" <span style="background-color:Yellow; %>
<span style="color:Blue; <!<span style="color:#A31515; DOCTYPE <span style="color:Red; html<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; html <span style="color:Red; lang<span style="color:Blue; =<span style="color:Blue; "en"<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; head<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; title<span style="color:Blue; >Add Contacts<span style="color:Blue; </<span style="color:#A31515; title<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; head<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; body<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; script <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; >
Sub validationComplete(sender As Object, e As EventArgs)
if Page.IsValid then
Dim strConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnection += "Data Source=Contacts.sdf"
Dim connection as new OledbConnetion(strConnection)
connetion.Open()
else
end If
end sub
<span style="color:Blue; </<span style="color:#A31515; script<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; div <span style="color:Red; class<span style="color:Blue; =<span style="color:Blue; "field"<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; h2<span style="color:Blue; >Add Contact!!<span style="color:Blue; </<span style="color:#A31515; h2<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; form <span style="color:Red; method<span style="color:Blue; =<span style="color:Blue; "post" <span style="color:Red; action<span style="color:Blue; =<span style="color:Blue; "default.aspx" <span style="color:Red; onsubmit<span style="color:Blue; =<span style="color:Blue; "validationComplete" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; p<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >First Name:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; TextBox <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "fName" <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "text" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />*
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RequiredFieldValidator <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "fNameValidate" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "fName"
<span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Missing First Name" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Last Name:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; TextBox <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "lName" <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "text" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "Server" <span style="color:Blue; />*
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RequiredFieldValidator <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "lNameValidate" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "lName"
<span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Missing Last Name" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Age:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; TextBox <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "age" <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "number" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RequiredFieldValidator <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "ageValidate" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "age"
<span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Please enter in a valid Age of between 1 and 100" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RangeValidator <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "ageRangeValidation" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "age" <span style="color:Red; Type<span style="color:Blue; =<span style="color:Blue; "Integer"
<span style="color:Red; MinimumValue<span style="color:Blue; =<span style="color:Blue; "1" <span style="color:Red; MaximumValue<span style="color:Blue; =<span style="color:Blue; "100" <span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Your age is invalid, values arebetween 1 and 100"
<span style="color:Red; Display<span style="color:Blue; =<span style="color:Blue; "Dynamic" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RangeValidator<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Phone:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; TextBox <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "phone" <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "tel" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RegularExpressionValidator <span style="color:Red; ID<span style="color:Blue; =<span style="color:Blue; "phoneNumberValidation" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "phone"
<span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Invalid Phone Number"
<span style="color:Red; ValidationExpression<span style="color:Blue; =<span style="color:Blue; "^(??:+?1s*(?:[.-]s*)?)?(?s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))s*(?:[.-]s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})s*(?:[.-]s*)?([0-9]{4})(?:s*(?:#|x.?|ext.?|extension)s*(d+))?$"
<span style="color:Red; Display<span style="color:Blue; =<span style="color:Blue; "Dynamic" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RegularExpressionValidator<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Cell:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; input <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "tel" <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "cPhone" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Gender:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; > <span style="color:Blue; <<span style="color:#A31515; div <span style="color:Red; class<span style="color:Blue; =<span style="color:Blue; "pushOver"<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Male<span style="color:Blue; <<span style="color:#A31515; input <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "radio" <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "fmale" <span style="color:Blue; /><span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; > <span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; br<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Female<span style="color:Blue; <<span style="color:#A31515; input <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "radio" <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "male"<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; > <span style="color:Blue; </<span style="color:#A31515; div<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Email:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; > <span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; TextBox <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "email" <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "email" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RegularExpressionValidator <span style="color:Red; ID<span style="color:Blue; =<span style="color:Blue; "emailNumberValidation" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "email"
<span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Invalid email - please conform: sample@mail.com"
<span style="color:Red; ValidationExpression<span style="color:Blue; =<span style="color:Blue; "^[w-]+(.[w-]+)*@([a-z0-9-]+(.[a-z0-9-]+)*?.[a-z]{2,6}|(d{1,3}.){3}d{1,3})d{4})?$"
<span style="color:Red; Display<span style="color:Blue; =<span style="color:Blue; "Dynamic" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RegularExpressionValidator<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >News Letter?:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; > <span style="color:Blue; <<span style="color:#A31515; input <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "checkbox"<span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; Button <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "submit" <span style="color:Red; Text<span style="color:Blue; =<span style="color:Blue; "Submit" <span style="color:Red; onClick<span style="color:Blue; =<span style="color:Blue; "validationComplete" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; p<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; form<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; div<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; body<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; html<span style="color:Blue; >
[/code]
<br/>
<br/>
<hr class="sig Adrien....What?
View the full article
My issue is that even with: Import Namespace="System.Data.OleDb" on the page I am getting:
<span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif Type OledbConnetion is not defined. I am extremly new to VB, I am coming from java and honestly I do not have all year to read vb code and take classes and read books. I need to finish
this app for a client so I am kind of rushed.
<span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif Any ways the code is as follows:
<span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; Sub validationComplete(sender <span style="color:Blue; As <span style="color:Blue; Object, e <span style="color:Blue; As EventArgs)
<span style="color:Blue; if Page.IsValid <span style="color:Blue; then
<span style="color:Blue; Dim strConnection <span style="color:Blue; as <span style="color:Blue; String = <span style="color:#A31515; "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnection += <span style="color:#A31515; "Data Source=Contacts.sdf"
<span style="color:Blue; Dim connection <span style="color:Blue; as <span style="color:Blue; new OledbConnetion(strConnection)
connetion.Open()
<span style="color:Blue; else
<span style="color:Blue; end <span style="color:Blue; If
<span style="color:Blue; end <span style="color:Blue; sub
[/code]
<br/>
Help is appreciated!
Also for those interested the page ode is bellow - if you could maybe give me tips on how to take the data entered from the forum and insert it into the table for the database that would be awesome. things I need to check for:
If male or female is selected M or F needs to be inserted and if news letter is selected N needs to be inserted into the database.
<div style="color:Black;background-color:White; <pre>
<span style="background-color:Yellow; <%<span style="color:Blue; @ <span style="color:#A31515; Page <span style="color:Red; Language<span style="color:Blue; =<span style="color:Blue; "VB" <span style="color:Red; Debug<span style="color:Blue; =<span style="color:Blue; "true" <span style="color:Red; AutoEventWireUp<span style="color:Blue; =<span style="color:Blue; "True"<span style="background-color:Yellow; %>
<span style="background-color:Yellow; <%<span style="color:Blue; @ <span style="color:#A31515; Import <span style="color:Red; Namespace<span style="color:Blue; =<span style="color:Blue; "System.Data.OleDb" <span style="background-color:Yellow; %>
<span style="background-color:Yellow; <%<span style="color:Blue; @ <span style="color:#A31515; Import <span style="color:Red; Namespace<span style="color:Blue; =<span style="color:Blue; "System.Text.RegularExpressions" <span style="background-color:Yellow; %>
<span style="color:Blue; <!<span style="color:#A31515; DOCTYPE <span style="color:Red; html<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; html <span style="color:Red; lang<span style="color:Blue; =<span style="color:Blue; "en"<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; head<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; title<span style="color:Blue; >Add Contacts<span style="color:Blue; </<span style="color:#A31515; title<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; head<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; body<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; script <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; >
Sub validationComplete(sender As Object, e As EventArgs)
if Page.IsValid then
Dim strConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnection += "Data Source=Contacts.sdf"
Dim connection as new OledbConnetion(strConnection)
connetion.Open()
else
end If
end sub
<span style="color:Blue; </<span style="color:#A31515; script<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; div <span style="color:Red; class<span style="color:Blue; =<span style="color:Blue; "field"<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; h2<span style="color:Blue; >Add Contact!!<span style="color:Blue; </<span style="color:#A31515; h2<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; form <span style="color:Red; method<span style="color:Blue; =<span style="color:Blue; "post" <span style="color:Red; action<span style="color:Blue; =<span style="color:Blue; "default.aspx" <span style="color:Red; onsubmit<span style="color:Blue; =<span style="color:Blue; "validationComplete" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; p<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >First Name:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; TextBox <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "fName" <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "text" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />*
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RequiredFieldValidator <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "fNameValidate" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "fName"
<span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Missing First Name" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Last Name:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; TextBox <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "lName" <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "text" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "Server" <span style="color:Blue; />*
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RequiredFieldValidator <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "lNameValidate" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "lName"
<span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Missing Last Name" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Age:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; TextBox <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "age" <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "number" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RequiredFieldValidator <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "ageValidate" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "age"
<span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Please enter in a valid Age of between 1 and 100" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RangeValidator <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "ageRangeValidation" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "age" <span style="color:Red; Type<span style="color:Blue; =<span style="color:Blue; "Integer"
<span style="color:Red; MinimumValue<span style="color:Blue; =<span style="color:Blue; "1" <span style="color:Red; MaximumValue<span style="color:Blue; =<span style="color:Blue; "100" <span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Your age is invalid, values arebetween 1 and 100"
<span style="color:Red; Display<span style="color:Blue; =<span style="color:Blue; "Dynamic" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RangeValidator<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Phone:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; TextBox <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "phone" <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "tel" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RegularExpressionValidator <span style="color:Red; ID<span style="color:Blue; =<span style="color:Blue; "phoneNumberValidation" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "phone"
<span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Invalid Phone Number"
<span style="color:Red; ValidationExpression<span style="color:Blue; =<span style="color:Blue; "^(??:+?1s*(?:[.-]s*)?)?(?s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))s*(?:[.-]s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})s*(?:[.-]s*)?([0-9]{4})(?:s*(?:#|x.?|ext.?|extension)s*(d+))?$"
<span style="color:Red; Display<span style="color:Blue; =<span style="color:Blue; "Dynamic" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RegularExpressionValidator<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Cell:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; input <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "tel" <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "cPhone" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Gender:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; > <span style="color:Blue; <<span style="color:#A31515; div <span style="color:Red; class<span style="color:Blue; =<span style="color:Blue; "pushOver"<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Male<span style="color:Blue; <<span style="color:#A31515; input <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "radio" <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "fmale" <span style="color:Blue; /><span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; > <span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; br<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Female<span style="color:Blue; <<span style="color:#A31515; input <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "radio" <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "male"<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; > <span style="color:Blue; </<span style="color:#A31515; div<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >Email:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; > <span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; TextBox <span style="color:Red; id<span style="color:Blue; =<span style="color:Blue; "email" <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "email" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RegularExpressionValidator <span style="color:Red; ID<span style="color:Blue; =<span style="color:Blue; "emailNumberValidation" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server" <span style="color:Red; ControlToValidate<span style="color:Blue; =<span style="color:Blue; "email"
<span style="color:Red; ErrorMessage<span style="color:Blue; =<span style="color:Blue; "Invalid email - please conform: sample@mail.com"
<span style="color:Red; ValidationExpression<span style="color:Blue; =<span style="color:Blue; "^[w-]+(.[w-]+)*@([a-z0-9-]+(.[a-z0-9-]+)*?.[a-z]{2,6}|(d{1,3}.){3}d{1,3})d{4})?$"
<span style="color:Red; Display<span style="color:Blue; =<span style="color:Blue; "Dynamic" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; RegularExpressionValidator<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; label<span style="color:Blue; >News Letter?:<span style="color:Blue; </<span style="color:#A31515; label<span style="color:Blue; > <span style="color:Blue; <<span style="color:#A31515; input <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "checkbox"<span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; br<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; asp<span style="color:Blue; :<span style="color:#A31515; Button <span style="color:Red; type<span style="color:Blue; =<span style="color:Blue; "submit" <span style="color:Red; Text<span style="color:Blue; =<span style="color:Blue; "Submit" <span style="color:Red; onClick<span style="color:Blue; =<span style="color:Blue; "validationComplete" <span style="color:Red; runat<span style="color:Blue; =<span style="color:Blue; "server"<span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; p<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; form<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; div<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; body<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; html<span style="color:Blue; >
[/code]
<br/>
<br/>
<hr class="sig Adrien....What?
View the full article