canurao Posted November 20, 2008 Report Share Posted November 20, 2008 I need to perform validations against database. If row exists then it should populate error. For this i have used "ValidatingFieldInput" event. For insert it is working fine. When i am trying to update the then this validation is fired and always returns error message. Can any one tell me how to avoid this problem. Here is the sample code i am using this validation need to execute for insert and update (only if old vale and new value is not same) protected void grdAssetTypes_ValidatingFieldInput(object sender, FieldInputValidationEventArgs e) { if (e.Field.DataPath == "AT_str_AssetType") { dsATAR.ATAR_AssetTypesRow ARow = null;ARow = AtarAssetDT.FindByAT_str_AssetType(e.InputValue.ToString());if (ARow != null) {e.ErrorMessage = "Error: Asset Type Exists";e.IsValid = false; } } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.