[SOLVED] Error Provider Clear Problem

Answered
0
0

Hi

Error provider Clear() method not work

 

 

  • You must to post comments
Best Answer
0
0

Thanks. Logged as #1902. It works on the server but doesn’t update the client. This is a  quick workaround:

public class MyErrorProvider : ErrorProvider
{
    protected override void OnWebRender(dynamic config)
    {
       base.OnWebRender((object)config);
       if (!this.Haserror)
           config.errors = null;
    }
}


  • You must to post comments
0
0

Hi,

#1902 is fixed in Wisej release 2.0.32.

Best regards
Frank

  • You must to post comments
0
0

Hit the same issue, but there is a minor error in Luca’s code (Haserror should be HasErrors – casing and plural).

Some additional information to help:

1. Create a new class in your project with the constructors for all the ErrorProvider options and the default without value. I tried to use a dynamic but the designer didn’t like it (even though the code still worked). (eg below)

using Wisej.Web;

namespace MyProject.WiseJCustomClasses {
public class CustomErrorProvider : ErrorProvider {
private IContainer container;
private IContainerControl containerControl;

public CustomErrorProvider() { }

public CustomErrorProvider(IContainer container) {
this.container = container;
}

public CustomErrorProvider(IContainerControl containerControl) {
this.containerControl = containerControl;
}

protected override void OnWebRender(dynamic config) {
base.OnWebRender((object)config);
if (!this.HasErrors) {
config.errors = null;
}
}
}

2. Edit your designer code where the ErrorProvider is created and change to the Custom Error Provider (eg below)

this.errorProvider1 = new WiseJCustomClasses.CustomErrorProvider(this.components);

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.