Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ErrorMessage

Reply
Thread Tools

ErrorMessage

 
 
Kenny
Guest
Posts: n/a
 
      07-05-2003
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


 
Reply With Quote
 
 
 
 
David Waz...
Guest
Posts: n/a
 
      07-06-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

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: IIS errormessage referrs non-existing linenumber Phil Winstanley [Microsoft MVP ASP.NET] ASP .Net 1 06-21-2004 11:35 AM
IIS errormessage referrs non-existing linenumber Christina N ASP .Net 0 06-21-2004 11:17 AM
Reset errormessage on CustomValidator =?Utf-8?B?RG9ydGU=?= ASP .Net 1 05-07-2004 01:31 PM
The position of the validator errormessage Arjen ASP .Net 2 08-02-2003 11:44 AM
Errormessage in CustomValidator Edmilson ASP .Net 0 07-10-2003 12:56 PM



Advertisments