OnServerValidate not firing for custom validator

Discussion in 'ASP .Net Web Controls' started by prady, Mar 12, 2007.

  1. prady

    prady Guest

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


    I am checking page.validate on Page load

    if (IsPostBack)
    {
    Page.Validate();
    }

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

    Thanks
    Prady
    prady, Mar 12, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jm
    Replies:
    3
    Views:
    4,716
    Greg Burns
    Oct 16, 2003
  2. Mike P

    OnServerValidate

    Mike P, Oct 23, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    824
    Mike P
    Oct 23, 2003
  3. Rigs
    Replies:
    0
    Views:
    362
  4. Rigs
    Replies:
    10
    Views:
    8,360
    Laurent Bugnion
    Nov 17, 2006
  5. Replies:
    3
    Views:
    768
Loading...

Share This Page