Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default ErrorMessage

    Hi,
    Is it possible to call a function from a control, for e.g
    <asp:requiredfieldvalidator id="test" errormessage="ccc" />

    Is it possible for me to create a FormatErrorMessage function if I want to
    change the text of the message.

    <asp:requiredfieldvalidator id="test" errormessage="<%
    FormatErrorMessage('test','Invalid input') %>" />

    public string FormatErrorMessage(string s, string t)
    {
    s.ErrorMessage = "Required Fields: " + s + "-" + t;
    }

    Thanks.
    Kenny Kee


    Kenny Guest

  2. Similar Questions and Discussions

    1. Coldfusion 8 Unable to invoke CFC always added to errormessage
      Since switching to ColdFusion 8, I noticed some weird issues with the returned error messages from the CFC. Let's say I call my login function from...
    2. Change ErrorMessage Text Dynamically
      Is there a way to set/change the ErrorMessage and/or Text property of validationcontrols without making a trip to the server? What I have so far...
    3. CFMX 7 will not start reliably on JRun 4 - no errormessage
      I've been having a problem for a while with JRun 4 and MX. I thought upgraded to MX 7 would solve it but no luck. Basically MX is configured to...
    4. The position of the validator errormessage
      Hello, I have a table record with two validators. The can not be both false. When the first one will be false the errormessage will be placed...
    5. Errormessage in CustomValidator
      Hi, I´m using a server function in a CustomValidator control to verify a field date content before an insert process. What should I do to avoid...
  3. #2

    Default Re: ErrorMessage

    That's all a standard part of the validator controls. Nothing too fancy to
    do this.

    <asp:RequiredFieldValidator ID=Test ...blah blah... />

    code behind:
    protected Test as RequiredFieldValidator...


    Private Sub Test_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Handles Test.Load

    Test.ErrorMessage = "Anything you want to say here"

    End Sub



    "Kenny" <keejh@hotmail.com> wrote in message
    news:eSIVATxQDHA.3700@tk2msftngp13.phx.gbl...
    > Hi,
    > Is it possible to call a function from a control, for e.g
    > <asp:requiredfieldvalidator id="test" errormessage="ccc" />
    >
    > Is it possible for me to create a FormatErrorMessage function if I want to
    > change the text of the message.
    >
    > <asp:requiredfieldvalidator id="test" errormessage="<%
    > FormatErrorMessage('test','Invalid input') %>" />
    >
    > public string FormatErrorMessage(string s, string t)
    > {
    > s.ErrorMessage = "Required Fields: " + s + "-" + t;
    > }
    >
    > Thanks.
    > Kenny Kee
    >
    >

    David Waz... Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139