Validating custom control

Validation is required to prevent invalid data and ensure useful data in the application..

So validation is very necessary for an application.

There may be many inbuilt validations in an application.

If you want to use a custom validation to ensure useful data in an application then you can do that.

i am using a custom control fol file upload ( want to apply a constraint that user must upload at least one file. so when he click submit button, if he/she hasn't uploaded a file with this control then he/she must receive an error, just like other mandatory textboxes. k i think u will be inserting the path in the database right. I sent the Control Library (DLL) to a friend, and he managed to use it properly. I need to add some validation (like requiredfieldvalidator, comparevalidator, etc).

with regular control like textbox it is quite easy to do. but somehow it is not is file :and isusing System;using System. if ur calling the managepost() method while u r uploading the file in the server get the path in the hidden field and then u can check it in the server side or clientside to see whether it is null or not in the button click event. I am assuming this is a problem with my Visual Studio. I would normally add the validator to my web user control by placing the validator next to my textbox. So I thought about it is gonna be better than make a Web Custom Control, so i thought again, nope...

and its requirement that user must upload one file. I also tried double-clicking them from the toolbox but it still won't work. I...validate Textbox in Web User Control from web form? NET 2.0 I have a web user control that contains a textbox.

it means if user hasn't filled that field, it will give an error when submitbutton for the panel is clicked. I cannot drag web custom controls from toolbox to web form I have created some web custom controls (both composite controls or derived/inherited controls). However, when I try to drag them onto the form, the cursor changes into a black circle with a diagonal line, and cannot drag them.

if its null u can show him the error message..:) u can assign the filename in the hidden field like this in ur sorce code take a hidden field control like this sorry i didn't debugg earlier. It'll never be converted to a date (stored as string) but I would like to know the best time to validate that data (and provide feedback).Note: It may seem a bit like re-inventing the wheel, but the app that I'm writing gets deployed to a tablet-pc and the winforms On Validate happens after the Loading events (source) You should validate on the client-side (javascript) AND server side either using the On Validate or when handling the submission of the form (or both).Windows Presentation Foundation allows the developers to create attractive Windows applications by provided styles, graphics etc.One the major pain points of using WPF is that it lacks the validation framework.

Leave a Reply