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.