November Happy Hour will be moved to Thursday December 5th.

Summary validation issue

Vote:
 

EPiServer dynamic content summary validation control does not gather errors from <asp:CustomValidator … />

We expect to see an error message in yellow box at top of the dynamic content window the same as in a custom validation control, but it appears with empty string

#38260
Apr 06, 2010 16:12
Vote:
 

Did you set the validationgroup property?

<asp:ValidationSummary ID="XFormValidationSummary" runat="server" ValidationGroup="XForm" />



                        
#38267
Apr 06, 2010 18:13
Vote:
 

I don't manage validation groups at all, but error messages from all another validators (CompareValidator for example) appear in top epi summary control but only from CustomValidator do not. Summary control appears with warning icon and empty string instead a real error  message.

#38409
Apr 09, 2010 8:00
Vote:
 

Could you post the code for your XForm control? (the markup from xform.ascx)

#38411
Apr 09, 2010 8:42
Vote:
 

It is not XForm. It's form setting for a dynamic content. Murckup and C# codу you can find below. Thanks for response.

<%@ Control Language="C#" CodeBehind="QuickPollSettings.ascx.cs" Inherits="Maggie.Web.CustomPropertyTypes.DynamicContent.QuickPoll.QuickPollSettings" %>
<%@ Import Namespace="EPiServer.Core" %>
<asp:ScriptManager runat="server" ID="scriptManager">
</asp:ScriptManager>
<div class="quickPollFilter">
 <asp:CustomValidator ID="dateRangeValidator" EnableClientScript="false" runat="server" OnServerValidate="dateValidate" Text="End date should be great than start date"/>
<p class="quickPollFilterTitle">
<%= LanguageManager.Instance.Translate("/quickPoll/selectFilterText")%>
</p>
<div class="epirowcontainer">
<label class="epiindent episize100">
<%= LanguageManager.Instance.Translate("/quickPoll/filterStartCreationDateText")%>
</label>
<EPiServer:InputDate ID="cdStartDayFilter" runat="server" style="display: inline;" DisplayName="Start Date" DisplayTime="false" ValidateInput="true" />
</div>
<div class="epirowcontainer">
<label class="epiindent episize100">
<%= LanguageManager.Instance.Translate("/quickPoll/filterEndCreationDateText")%>
</label>
<EPiServer:InputDate ID="cdEndDayFilter" runat="server" DisplayName="End Date" style="display: inline;" DisplayTime="false" ValidateInput="true"/>
</div>
<div class="epirowcontainer">
<span style="white-space:nowrap">
<label class="epiindent episize100">
<%= LanguageManager.Instance.Translate("/quickPoll/filterNameText")%>
</label>
<asp:TextBox runat="server" ID="tbFilterName" CssClass="episize240"></asp:TextBox>
<asp:Button runat="server" ID="btApplyFilter" OnClick="btApplyFilter_Click" Text='<%# LanguageManager.Instance.Translate("/quickPoll/applyButtonText")%>'>
</asp:Button>
</span>
</div>
<div class="epirowcontainer">
<label class="epiindent episize100">
<%= LanguageManager.Instance.Translate("/quickPoll/pollList")%>
</label><span class="quickPollListBox">
<asp:ListBox ID="lbPolls" DataTextField="Key" CssClass="episize240" DataValueField="Value" runat="server"
SelectionMode="Single" Rows="1" />
</span>
</div>
</div>

Code behind C#

protected void dateValidate(object source, ServerValidateEventArgs args)
{
if (cdEndDayFilter.Input.Text.Length > 0 && cdEndDayFilter.Value < cdStartDayFilter.Value)
{
args.IsValid = false;
}
}

#38412
Apr 09, 2010 8:50
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.