Validator's ErrorMessage is decoded

Discussion in 'ASP .Net' started by Jacob Andersen, Jun 24, 2010.

  1. Hi

    On a CustomValidator I have ErrorMessage="You cannot enter <, >, &lt; or
    &gt;". When CustomValidator.IsValid is false the error message is
    rendered as "You cannot enter <, >, < or >". How can I avoid this
    decoding?

    PS. Yes, I know the error message is stupid but it's needed in this case
    :)
     
    Jacob Andersen, Jun 24, 2010
    #1
    1. Advertising

  2. Jacob Andersen wrote:
    > Hi
    >
    > On a CustomValidator I have ErrorMessage="You cannot enter <, >, &lt; or
    > &gt;". When CustomValidator.IsValid is false the error message is
    > rendered as "You cannot enter <, >, < or >". How can I avoid this
    > decoding?
    >
    > PS. Yes, I know the error message is stupid but it's needed in this case
    > :)


    That's interesting. Well, try "You cannot enter <, >, &amp;lt; or &amp;gt;."
     
    Harlan Messinger, Jun 25, 2010
    #2
    1. Advertising

  3. In article <>,
    says...

    > > On a CustomValidator I have ErrorMessage="You cannot enter <, >,

    &lt; or
    > > &gt;". When CustomValidator.IsValid is false the error message is
    > > rendered as "You cannot enter <, >, < or >". How can I avoid this
    > > decoding?
    > >
    > > PS. Yes, I know the error message is stupid but it's needed in this case
    > > :)

    >
    > That's interesting. Well, try "You cannot enter <, >, &amp;lt; or &amp;gt;."


    Hi! Your suggestion renders:

    "You cannot enter <, >, < or >."

    Very strange! That means the ErrorMessage is double decoded. Does anyone
    have a solution or hack to this problem?
     
    Jacob Andersen, Jun 27, 2010
    #3
  4. Try this out:

    CustomValidator I have ErrorMessage="You cannot enter <, >, &amp;lt; or
    &amp;gt;"


    Sarath Babu S
    http://www.consultsarath.com/


    "Jacob Andersen" <> wrote in message
    news:...
    > Hi
    >
    > On a CustomValidator I have ErrorMessage="You cannot enter <, >, &lt; or
    > &gt;". When CustomValidator.IsValid is false the error message is
    > rendered as "You cannot enter <, >, < or >". How can I avoid this
    > decoding?
    >
    > PS. Yes, I know the error message is stupid but it's needed in this case
    > :)
    >
     
    Sarath Babu S, Jul 8, 2010
    #4
    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. Arjen
    Replies:
    2
    Views:
    361
    Michal A. Valasek
    Aug 2, 2003
  2. Roger Kjærnsrød
    Replies:
    1
    Views:
    480
    Peter Blum
    Sep 21, 2004
  3. JustMe
    Replies:
    0
    Views:
    441
    JustMe
    Oct 4, 2004
  4. Andy

    Validator Text vs. ErrorMessage

    Andy, Jul 14, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    717
  5. Steve

    Newline in Validator ErrorMessage

    Steve, Dec 23, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    196
    Steve
    Dec 23, 2003
Loading...

Share This Page