Validatorcalloutextender (Verification prompt)

Source: Internet
Author: User
< Div Class = "Demoarea" >
< Div Class = "Demoheading" > Validatorcallout demonstration </ Div >
< Table >
< Tr >
< TD > Name: </ TD >
< TD > < ASP: textbox Runat = "Server" ID = "Nametextbox"
Borderstyle = "Solid" Borderwidth = "1px" Bordercolor = "# A9a9a9"   /> </ TD >
</ Tr >
< Tr >
< TD > Phone number: </ TD >
< TD > < ASP: textbox Runat = "Server" ID = "Phonenumbertextbox"
Borderstyle = "Solid" Borderwidth = "1px" Bordercolor = "# A9a9a9"   /> </ TD >
</ Tr >
</ Table >
< BR />

< ASP: requiredfieldvalidator Runat = "Server" ID = "Nreq"
Controltovalidate = "Nametextbox"
Display = "NONE"
Errormessage = "<B> required field missing </B> <br/> A name is required ."   />
< Ajaxtoolkit: validatorcalloutextender Runat = "Server" ID = "Nreqe"
Targetcontrolid = "Nreq"
Highlightcssclass = "Validatorcallouthighlight"   />

< ASP: requiredfieldvalidator Runat = "Server" ID = "Pnreq"
Controltovalidate = "Phonenumbertextbox"
Display = "NONE"
Errormessage = "<B> required field missing </B> <br/> A phone number is required. <Div style = 'margin-top: 5px; padding: 5px; Border: 1px solid # e9e9e9; Background-color: White; '> <B> other options: </B> <br/> <a href = 'javascript: Alert (& quot; no phone number available in profile. & quot;); '> extract from profile </a> </div>"   />
< Ajaxtoolkit: validatorcalloutextender Runat = "Server" ID = "Pnreqe"
Targetcontrolid = "Pnreq"
Highlightcssclass = "Validatorcallouthighlight"
Width = "350px"   />

< ASP: regularexpressionvalidator Runat = "Server" ID = "Pnregex"
Controltovalidate = "Phonenumbertextbox"
Display = "NONE"
Validationexpression = "(\ D {3 }\)?) | (\ D {3 }-))? \ D {3}-\ D {4 }"
Errormessage = "<B> Invalid Field </B> <br/> Please enter a phone number in the format: <br/> (###) ###-####"   />
< Ajaxtoolkit: validatorcalloutextender Runat = "Server" ID = "Pnreqex"
Targetcontrolid = "Pnregex"
Highlightcssclass = "Validatorcallouthighlight"   />

< ASP: button ID = "Button1" Runat = "Server" Text = "Submit" Onclick = "Button1_onclick"   /> < BR /> < BR />
< ASP: updatepanel Runat = "Server" ID = "Up1" >
< Contenttemplate >
< ASP: Label ID = "Lblmessage" Runat = "Server"   />
</ Contenttemplate >
< Triggers >
< ASP: asyncpostbacktrigger Controlid = "Button1" Eventname = "Click"   />
</ Triggers >
</ ASP: updatepanel >
</ Div >

CS: Protected   Void Button1_onclick ( Object Sender, eventargs E)
{< br> lblmessage. text = string . format ( " thanks {0 }, we'll give you a call at {1 }. " , nametextbox. text, phonenumbertextbox. text);
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.