Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > BOOK: Beginning ASP.NET 2.0 and Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 2.0 and Databases
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 and Databases by John Kauffman, Bradley Millington; ISBN: 9780471781349
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 and Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 6th, 2008, 06:13 AM
Registered User
 
Join Date: Apr 2008
Location: Kettering, Northamptonshire, United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Custom Validation c# example

asp.net 2.0 databases p344 custom validator
This is a great example and one of the few places on the net that shows me how to do this. Problem is I need the script in c#, and I cannot get this to work. Can anyone show me the proper script in c# for the code below in the example
Thanx in advance;)
<script runat="server">

    Protected Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
        ' must be under age 25 to get a student membership
        If RadioButtonList1.SelectedValue = "S" And _
            CDate(DobTextBox.Text) < DateAdd("yyyy", -25, Today()) _
            Then args.IsValid = False
        ' must be over 65 to get an emeritus membership
        If RadioButtonList1.SelectedValue = "E" And _
            CDate(DobTextBox.Text) > DateAdd("yyyy", -65, Today()) _
            Then args.IsValid = False
    End Sub
</script>

  #2 (permalink)  
Old July 6th, 2008, 08:13 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

You may want to take a look here: http://converter.telerik.com/

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Server Control....Custom Property Editor ZArrinPour ASP.NET 1.0 and 1.1 Basics 1 June 15th, 2010 11:30 AM
Web Service, Custom Control, Custom Return Type robzyc ASP.NET 2.0 Basics 6 June 10th, 2008 08:03 AM
Custom Validation Control Client side event rodmcleay ASP.NET 1.0 and 1.1 Basics 3 December 17th, 2004 08:47 AM
Posting form After Custom Client-side validation rathbird General .NET 3 March 4th, 2004 06:03 PM
Custom validation fluff ASP.NET 1.0 and 1.1 Basics 2 November 19th, 2003 08:10 AM



All times are GMT -4. The time now is 09:35 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.