We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Tabstrip, Toolbar, Postback and force validation

I'm using a tabstrip with a toolbar inside each multi-view (used in conjunction with the tabstrip). I have not gotten around to switching the multi-page for the multi-view since verything is working.

The one problem I'm experiencing is the Toolbar performs a postback (as expected) but doesn't cause the validation controls to execute and "stop" the post back when they fail validation tests. I have an "Add", "Edit", "Delete", "Update" and "Cancel" button on the toolbar and only need the validation controls to execute when the "Update" toolbar item is selected. Is there anything equivalent to "CausesValidation" property or another method of running all validations and stopping the post back when they fail?

Thanks,

James.

3 Replies

LK Lakxman Kumar C Syncfusion Team May 27, 2010 12:28 PM UTC

Hi James,

Thank you for your interest in Syncfusion Products.

Could you please provide us more information on what do you like to validate when the 'Update' toolbar item is clicked? Meanwhile, you can also try implementing the validations in the "ClientOnItemSelect" client side event of the Toolbar Item. If the validation fails, you can stop the postback by just returning 'false'. You can find more information of using them in the Online Sample in the link below

http://samples.syncfusion.com/ASPNET/8.2.0.18/Web/Tools.Web/samples/3.5/MenuPackage/Toolbar-BasicFeatures/ClientSideEvent/cs/ClientSideEvent.aspx?args=2

Kindly try the above and let us know if this works.

Regards,
Lakxman Kumar C


JK James Knowlton May 29, 2010 07:05 PM UTC

An example of the problem is a Required Field Validator inside an EditItemTemplate of a DetailView control. The DetailView is inside a Multiview control. I have a toolbar that when clicked calls an sub routine in the code behind page using the OnClick="SubRoutineName" attribute. When I click the toolbar item the "OnClick" routine executes but none of the pages validation control execute. If I was using a CommandButton I could set the "CausesValidation" attribute to true and the page validates before the CommandButton's onClicked event executes.

I've worked around the issue but calling the Page.Validate() and then checking the Page.IsValid() property in the toolbar's onClick routine (only when the specific UPDATE toolbar item I'm interested in is clicked) and this works ok, but it seems to me that the toolbar item (since it posts back) should have the ability similiar to a command button to "cause validation" when clicked. I was just hoping there was a property setting I had overlooked.

Thanks,

James.


LK Lakxman Kumar C Syncfusion Team June 1, 2010 01:32 PM UTC

Hi James,

We regret to let you know that currently we dont have this feature in our library. We have notified our Developer Team for further analysis of this feature.

Thank you for your interest in Syncfusion Products.

Regards,
Lakmxan Kumar C

Loader.
Live Chat Icon For mobile
Up arrow icon