| | |
Custom Web Server Control That Validate Itself
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2006
Posts: 6
Reputation:
Solved Threads: 0
hello everybody:
i am new to VB.net I have to design a custom web server control which validates itself on client side and server-side. which means that i would not use a seperate custom validator for validation, but it should be a part of the custom control itself.and this validation would be done on clientside first, and incase javascript is off in browser then validation is done on server side.
The description of the custom control is as follows:
its a date control which has 3 dropdowns(dds).one for month, second for days and third for days.it has two properties isDOB(boolean) and getDate which returns the date in the format mm/dd/yyyy.
one method setDate which takes the string inn the format mm/dd/yyyy.This will set date according to the input string.
can somebody point me to the rite direction.any help would be deeply appreciated.
Thanks
Cheers!
AB
Aamir Babar
i am new to VB.net I have to design a custom web server control which validates itself on client side and server-side. which means that i would not use a seperate custom validator for validation, but it should be a part of the custom control itself.and this validation would be done on clientside first, and incase javascript is off in browser then validation is done on server side.
The description of the custom control is as follows:
its a date control which has 3 dropdowns(dds).one for month, second for days and third for days.it has two properties isDOB(boolean) and getDate which returns the date in the format mm/dd/yyyy.
one method setDate which takes the string inn the format mm/dd/yyyy.This will set date according to the input string.
can somebody point me to the rite direction.any help would be deeply appreciated.
Thanks
Cheers!
AB
Aamir Babar
•
•
Join Date: Feb 2006
Posts: 6
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by campkev
a) what does isDOB represent
b) what do you want to validate
Thanks for ur reply.
here is the detail.
Actually this Date control wil have two types of behavior, and it will depend on this Public property IsDOB(is date of birth
) return type Boolean. if this is true, the date Dropdown(DD) will start from 1895 up to the current year -10.and as default year 1960 would be selected.it does not care about month DD and Day DD.
on the other hand if its false. Three dds will show the current date.while the year will start from 2002 up to current year.so this is the signaificance about IsDob.
Then r 2 other public properties.
public property GetDate() as string : return the date in the format mm/dd/yyyy.
one method:
SetDate(string) :set the date accordong to the input string.
Validation
----------
let say some one selects the sept month in month DD and day 31 in day dd. This should be validated first on the client side and then server side incase javascript fails(javascript is off).
other example would be leap year.some one select feb in leap year and 29 or more then 28 days in days DD.
So this kind of scinarios has to be validated.
i dont want to use a seperate custom validator for my control.
the validator cvontrol should be part of the date custom control itself.
if u still have any Qs please dont hasitate to ask me .
thanks
Ab
•
•
Join Date: Jan 2006
Posts: 275
Reputation:
Solved Threads: 11
you can use a custom validator in .net or any of the built in ones. By default all validators run on the client and on the server if java is not enabled on the client, so that solves that problem straight away.
Depending on your exact needs you just need a few validators. To limit the dates in each box, you can use range validators. You can change the range depending on the DOB checkbox etc. You can also use a regex if you wish to check the whole date is valid too. Then use a summary to list all errors. Group them all together for the summary and link your postback button to the same group so they cannot click it until validated.
Depending on your exact needs you just need a few validators. To limit the dates in each box, you can use range validators. You can change the range depending on the DOB checkbox etc. You can also use a regex if you wish to check the whole date is valid too. Then use a summary to list all errors. Group them all together for the summary and link your postback button to the same group so they cannot click it until validated.
![]() |
Similar Threads
- help setting up web server (Linux Servers and Apache)
- IIS Personal Web Server setting ??? (Windows NT / 2000 / XP)
- M6.Net presents all the web server power you need for big developments! (Web Hosting Deals)
- Printing using Web Control Print button VB.NET (JavaScript / DHTML / AJAX)
- running web-server on home network (Networking Hardware Configuration)
- Web Server controls to a file (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: A MFC linker error
- Next Thread: ASP.NET Import/Export
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox click commonfunctions compatible confirmationcodegeneration content contenttype courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dropdownmenu edit expose flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list listbox login menu microsoft mono mouse mssql multistepregistration nameisnotdeclared news numerical objects order panelmasterpagebuttoncontrols problem radio ratings reportemail rotatepage save schoolproject search security serializesmo.table silverlight smartcard software sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webprogramming webservice wizard xml youareanotmemberofthedebuggerusers





