Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > OnServerValidate not firing for custom validator

Thread Tools

OnServerValidate not firing for custom validator

Posts: n/a
I am creating a webform thru xslt. There are no of textboxes and and
reqfield validators , range validators etc inthe web form. All other controls
are also working fine. All the validations for the requiredfield validator,
range validator works fine.. Only the custom validator is not working ..
OnServerValidate ="test" does not fire for the custom validator.
This is the xslt

<xsl:for-each select="validation/validator">
<xsl:if test="@type='required'">
<asp:RequiredFieldValidator ErrorMessage="{text}" runat="server"
ControlToValidate="{$current_id}" ForeColor="{forecolor}"
<xsl:if test="@type='compare'">
<xsl:variable name="comparevalue">
<asp:value-of select="valuetocompare" />
<asp:CompareValidator ErrorMessage="{text}" runat="server"
ValueToCompare="{valuetocompare}" Operator="{operator}"
ForeColor="{forecolor}" Display="{display}"/>
<xsl:if test="@type='range'">
<asp:RangeValidator ErrorMessage="{text}" runat="server"
MaximumValue="{max}" MinimumValue="{min}"
ControlToValidate="{$current_id}" Type="Integer" ForeColor="{forecolor}"
<xsl:if test="@type='custom'" >
<asp:CustomValidator ErrorMessage="{text}" runat="server"
ControlToValidate="{$current_id}" OnServerValidate="test1"
ForeColor="{forecolor}" ValidateEmptyText="True" EnableClientScript="False" />

I am checking page.validate on Page load

if (IsPostBack)

Could any help me find out what could be the reason the server side function
is not firing

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Custom validator not firing. Any idea why? ASP .Net 3 06-01-2009 11:01 PM
Custom Validator Only Fires OnServerValidate When Data Exists Rigs ASP .Net 10 11-17-2006 08:02 AM
Fire OnServerValidate Method When No Value Exists in Textbox Rigs ASP .Net 0 06-28-2004 03:34 PM
OnServerValidate Mike P ASP .Net 3 10-23-2003 02:12 PM
Question about OnServerValidate jm ASP .Net 3 10-16-2003 09:10 PM