Controlling the controls a validator validates

Hello,

I want to control which controls appear for a validator when they go to controltovalidate dropdown in property grid.  Is the solution to create a designer for the control?  How do you regulate that?  I can't override the ControlToValidate property...

Thanks.


Brian

"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
0
bmains
3/8/2007 2:44:21 PM
asp.net.custom-server-controls 3498 articles. 0 followers. Follow

3 Replies
771 Views

Similar Articles

[PageSpeed] 32

Well ur logic is true, thats the way, what u need to do is not override the property (cant), create another property, that implement ur logic.


Regards
Ramzi
--------------------------------------------
Dont Forget to mark the post as answered once replied.
0
Ramzi
3/8/2007 3:20:08 PM

Boy Brian, you have been rewriting validation for a while now. You already know that I already did all of this, so let me give you a hint here.

While you cannot override ControlToValidate, you can create a ControlDesigner class that defines the PreFilterProperties() method. That method is allowed to insert or replace any attribute attached to the property, such as the EditorAttribute. I'm sure there are numerous examples on the web of using this property.


--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
0
PLBlum
3/8/2007 6:17:12 PM

Hello,

I was thinking that might be the solution, but wasn't sure if there was an easier way.  Thank you for the help.


Brian

"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
0
bmains
3/12/2007 12:52:40 PM
Reply:

Similar Artilces:

Creating a User Control validator that validates a control on the page, rather than inside the control.
I'm trying to create a custom user control that is nothing more than a RangeValidator that validates other controls that lie on the page rather than inside the control itself... is this possible, is there a way to "bubble" it up. Thanks, G My answer to your other question regarding the CompareValidator applies here. If the custom control is in the same naming container AND does not implement INamingContainer, you can create a property that lets the user assign the control to validate. Internally assign the Validator.ControlToValidate property to the value of that property.-...

Validation Control question
Hello.  I have a form with several validation controls checking input boxes.  This form also has a DDL (dropdownlist).  This form also has a formview control in insert mode - this formview control has the validation controls.  The formview visibility is set to false. When a user selects an item from the DDL (which causes a postback) I set the visibilty of the formview to true.  At this point the validation controls are showing errors in th evalidation summary even though the user has not attempted to do any inputs. Where or how can I control when the validation ...

Validation controls are triggereing other forms validation controls?
Can someone please look at this an explain whats going on. When you click on subscribe it triggers my registration form validation controls. I'not sure what "subscribe" is supposed to do, but if you dont want it to cause validation, set the CausesValidation property to false.Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/ Make sure the feild is an email address Hey coolkidsonly, your initial posting didn't show us anything to look at. We are just guessing here without the specifics. However, m...

How to display all of my validation controls in my Validation summary control?
I have a  validation summary control I am using on a web form to validate various controls on a web form. For one of the controls  which is a text box control, I have a custom validation control. When someone presses the save button, all of the controls are validated. If any errors occur, then the error message is displayed in the validation summary area above all of the controls. This is what I want. The problem though is that I also get an error message next to my text box which was assigned the custom validator control. The problem here is that the error message i...

Custom Control post back raises Validation Control's Validate event
Hi all, I have developed a custom pager control, which has been inherited from WebControl, IPostBackDataHandler. Function of the control is to render a pager layout ( page numbers, next, prev, buttons ) and raise an event on the server when page change in UI. Problem is what when i place any validator control which are validate on server only are raising validation on custom pager control's post back. code preview PreRender(){   // Registering client script block that set page index in hidden   // and submit the form} Render(){   // Rend...

how can i add my custom control to appear in validators' control to validate combo box?
Hi, pls give me some idea :P view post 836945 Shortly: your control needs to have ValidationProperty attribute applied.Thanks,Teemu KeiskiFinland, EU Hi thanks for you help. i mean i want to show my custom control id in required field validator's control to validate combo. i mean i want to show my custom control id in required field validator's control to validate combo. The same still applies, please check the post I linked to (RequiredFieldValidator's ControlToValidate property has ValidatedControlConverter applied, which picks up such controls, built-in ...

how to have both server controls and html controls rendered in a custom control?
I have a custom control in which there is an html text box.when you click on it , a div containing a table is appeared and according to what you select in that table a text is set to the text box. It works fine but the problem is: as the text box is an html element it doesn't have viewstate and when a post back occures in the page its value disappeares.I tried a hidden field to keep its value.again there is another problem : I put this custom control in a usercontrol and put the usercontrol in a multiview and by clicking on a button this view is selected and by clicking another bu...

Using Validation Control When the control to validate is initially hidden
Hi to all, When I used the validation controls (RequiredField Validator)  in initially VISIBLE controls, it works fine. But when the controls i want to validate is initially hidden, it seems that the validation doesn't not work. What do you think is the problem?  By the way, my hidden controls is in a table inside a PopUpPanel which is inside an UpdatePanel. Hope you can help me. Thanks Khrizz   khrizz Hello!! You can use like following: to avoid this condition. protected void button1_Click(object sender, EventArgs e) { &nbs...

validation control in runtime dont recognized control to validate
 i have repeater with textbox and dropdown, according t some value i set visible = true / false to each one of these controlsnow , in some textbox i want to add programaticly a required field to validate this text box and i get the following massage:  "Unable to find control id 'ROOT_UNIT' referenced by the 'ControlToValidate' property of ' ' "here is some code:    Private Const RootUnitControlId As String = "ROOT_UNIT" looping the repeater with repeater item (ri)     ElseIf type = SegmentInfo....

Custom Control within a Control Control
I am developing a custom controls that will render headers for different web sites. Within these controls, I want to place another custom control that will change the language. I created the language control and had it implement IPostBackDataHandler. This control works fine if I drag it on a new web form, but if I tell a header custom control to render it problems occur. The Language Selector custom control does not have a Page member anymore and the event handlers do not work. Does anyone have any experience with doing something similiar? Anyone have any suggestions? Thanks, ...

User Controls not working if I put Validation controls in user control
Hi           I have validation controls(RequiredField Validator,RegularExpressionValidator)  in user controls.User controls are not posting back like the events are not wiring up.If I remove Validation controls in User controls page,user controls are working fine.Can anyone please help me out in getting it fixed. In the Validation controls, make sure you are setting the ControlToValidate property to the control that it links to.  If you're in .NET 2.0, it's also a good idea to put all the validation controls in the same Valid...

Wizard Control
I have a wizard control. I some steps i want to disable the Causes Validation of the StepNextButton and for other steps i want to enable. When i convert the StepNextButton to template and set CausesValidation to false, its applied to all the steps. How could i control the properties of the Next Previous buttons of different steps and set the properties individually? ThanksMark post(s) as "Answer" that helped youElectronic ScrewWebsite||Blog||Dub@i.net Link into one of the events that fire when the step changes. Then check to see if its a step that you want to disable validation....

DetailsView Control, Validator Control
Hello,I am trying to add a RequiredFieldValidator Control to a template field in the DetailsView Control, here is the code: <asp:TemplateField HeaderText="*First Name:" SortExpression="FName"><ItemTemplate><asp:Label ID="Label1" runat="server" Text='<%# Bind("FName") %>'></asp:Label></ItemTemplate> <InsertItemTemplate><asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FName") %>' Width=200></asp:TextBox> <asp:RequiredFieldValidator runat="server" ErrorMessage="First Name is Required" ID="FNameValidator"></asp:Requir...

Validation Control in the User Control
I have phone(4 boxes for area code, phone no, ext.) user control, and placed the custom control in the user control. I have used this user control in the page, validation control error messages won't show up. Any help would be great. Suresh    ...

Web resources about - Controlling the controls a validator validates - asp.net.custom-server-controls

Talk:Controlling for a variable - Wikipedia, the free encyclopedia
This article is within the scope of the WikiProject Statistics , a collaborative effort to improve the coverage of statistics on Wikipedia. If ...

Controlling What You Share on Timeline - Facebook
Facebook and Privacy hat eine Notiz mit dem Titel Controlling What You Share on Timeline geschrieben. Du kannst den vollständigen Text hier lesen. ...

Balloon Snake - Pop Balloons by Controlling a Bird with the Accelerometer or by Touching on the App Store ...
Get Balloon Snake - Pop Balloons by Controlling a Bird with the Accelerometer or by Touching on the App Store. See screenshots and ratings, and ...

Controlling a Computer with Eyes - Flickr - Photo Sharing!
Some folks know I work with assistive technology, and this shot is one from many I took in the last few days at a conference in Phoenix. This ...

Controlling Doepfer modular synth with a Wiimote - YouTube
This video is about controlling a modular synth with Nintendo's wiimote gamepad, using Doepfer A-100, Doepfer MCV24, Wiimote and computer. Softwares ...

Controlling the minds of cockroaches using Microsoft's Xbox Kinect
Late last year, you were introduced to real, live, remote-controlled cockroaches. Well, the insect hackers at the North Carolina State University ...

CONTROLLING CHAOS: Twitter's Wild Ride From Doodle To IPO
CONTROLLING CHAOS: Twitter's Wild Ride From Doodle To IPO Business Insider Australia “We apologise if the following profile lacks our usual ...

View from the Street: Power to the people controlling the power!
Your news of the day, reduced to a snarky rant.

Dying to be clean: The new technique for controlling feral cats
Cleanliness may be next to godliness unless you're a feral cat, in which case, cleanliness may get you a place next to god. In kitty heaven, ...

Passwords the key to controlling Heartbleed
Stronger passwords are required to avoid being stung by Heartbleed.

Resources last updated: 12/16/2015 2:12:13 PM