Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validating a Control
Message
From
27/01/2005 20:35:28
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
Validating a Control
Miscellaneous
Thread ID:
00981581
Message ID:
00981581
Views:
59
Hi Guys,

I created a simple form with 3 textbox control. These 3 textboxes requires a value to be entered, so I use an error provider and put some code in the validating and validated event of the controls. The validation works for each control.

The problem occurs when I tried to enter a value into to first textbox and then clicking the save button without filling up the other 2 textboxes.

What I need is to call the validating event of each textboxes when I click the save button so that the error provider will set the error.

Is this possible? I tried to use the ctrl.invoke method but it does not work. I don't know if I just missed something or the approach is not right.

Here is the sample code that I placed in the click event of the Save button
CancelEventArgs ce = new CancelEventArgs(false);
this.txtDetails.Invoke(new MyDelegate(this.txtDetails_Validating),new object[]{this.txtDetails,ce}); 
this code does not produce an error but it does not do anything either.

Please Help...
Thanks in advance...
Music Rocks www.musicreserve.blogspot.com
Success is 1% Inspiration & 99% Perspiration
God Sometimes Delays His Help to Test Our Faith and Energize Our Prayers
Our Boat May Be Tossed While He Sleeps, But He Wakes Up Before it Sinks.
Next
Reply
Map
View

Click here to load this message in the networking platform