We have CodeEffects rule editor embedded into MVC View.
The editor is working well when editing a rule, but from time to time the editor RuleModel object is not instantiated/bound in action controller on server side upon submit (Null reference exception). Our code is as follows:
In View:
<div class="clear" style="margin-top: 20px">
@{
Html.CodeEffects().RuleEditor()
.Id("ruleEditor")
.ShowToolBar(false)
.Rule(Model.Rule)
.Mode(RuleType.Evaluation)
.Render();
}
</div>
In Controller:
public ActionResult UpdateRuleSet(CreateRuleSetModel model, RuleModel ruleEditor, RuleModel ruleEditorExceptions, string submit, FormCollection form)
{
//ruleEditor object is null (not being properly bound from form?)
//ruleEditorExceptions model is instantiated properly
...
}
We're having trouble reproducing this error as it only occurs on some server systems and not others (some test environments and also production in one instance - never occurred locally). The complexity of rule has no merit on the issue (can be simple rule).
What is strange is that application pool recycling ceases the issue and editor starts working again (on same rules that previously broke the application). Also a rule can break application on one client (browser) while other browser can save the same rule without issue (at the same time).
For now we're suspecting client side (form submission) but cannot confirm (and pool recycling workaround just adds to the mystery).
We use CodeEffects.Rule.dll version 4.1.2.6. (on .NET 4.0 framework).
Any guidance (other than CE update) is much appreciated.