473,989 Members | 38,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ErrorMessage

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

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

<asp:requiredfi eldvalidator id="test" errormessage="< %
FormatErrorMess age('test','Inv alid input') %>" />

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

Thanks.
Kenny Kee
Nov 17 '05 #1
1 1656
That's all a standard part of the validator controls. Nothing too fancy to
do this.

<asp:RequiredFi eldValidator ID=Test ...blah blah... />

code behind:
protected Test as RequiredFieldVa lidator...
Private Sub Test_Load(ByVal sender As Object, ByVal e As System.EventArg s)
Handles Test.Load

Test.ErrorMessa ge = "Anything you want to say here"

End Sub

"Kenny" <ke***@hotmail. com> wrote in message
news:eS******** ******@tk2msftn gp13.phx.gbl...
Hi,
Is it possible to call a function from a control, for e.g
<asp:requiredfi eldvalidator id="test" errormessage="c cc" />

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

<asp:requiredfi eldvalidator id="test" errormessage="< %
FormatErrorMess age('test','Inv alid input') %>" />

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

Thanks.
Kenny Kee

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

49
2688
by: Lauren Wilson | last post by:
Hi folks, Just wondered if, for the sake of clarity, it is permissible to post small image files of an error box along with a text message about a problem with Access?
0
1396
by: Edmilson | last post by:
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 the continuation of the process when the errormessage occurs ? tks ed
2
3323
by: Arjen | last post by:
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 at the left side of the record. When the second one will be false then the errormessage will be placed at the center of the record. That's the place where the first one will end if it was false too.
1
1797
by: Dorte | last post by:
Hi I am using a customvalidator to perform server validation of user input in webform1. When the user input has been validated, webform1 (which has the customvalidator and the user input) opens a new window (by adding a script to the web page that opens a new window by using response.write), redirects to webform2 in the new window. If user input is invalid, the error message of the customvalidator is displayed on webform1 and there is no...
4
10063
by: James | last post by:
Hello, I have a RequiredFieldValidator for several textbox controls on a form. Here's an example with the RequiredFieldValidator. EnableClientScript, Enabled, and Visible are set to true for the RequiredFieldValidator. <asp:textbox id="FirstName" MaxLength="25" runat="server"></asp:textbox>
3
1598
by: Diffident | last post by:
Guys, Does anyone have any clues about this stack trace? What can be the reason for this error? Is it something related to viewstate? Can I do anything at the application-level by making code changes to prevent this happening again? This error pops out when I click a particular button.....but error is not persistent in all the cases it is sporadic and happens once in 6-7 times
2
1903
by: PeterKellner | last post by:
I'm wanting to just show the error in a ValidationSummary control, not next to the actual TextField I'm putting a RequiredFieldValidator next to. I don't even want the little "*" showing which field it is. (strange requirement, but that's the way it is). I've found that if I set the attribute Text="" (zero length string), it always uses the ErrorMessage instead of Text. I need the ErrorMessage because that is what is going to show up...
1
1129
by: paul.hester | last post by:
Hi all, Is there any way to customize the error message display with validators. For example, with the following snippet: <tr> <td> <asp:RequiredFieldValidator runat="server" ControlToValidate="userName" Display="Dynamic" EnableClientScript="false" ErrorMessage="Please enter your
0
1340
by: jdp | last post by:
Is there a way to change/set the ErrorMessage and/or Text property of validationcontrols without making a trip to the server? What I have so far is a usercontrol that inherits from BaseValidator and overrides the Pre_Render event in which I have javascript code to do validation. I also override the AddAttributesToRender event to point to my new validation function. I'm looking to have a central repository of error messages so each...
0
10405
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11490
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11711
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10154
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8545
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7694
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6660
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5242
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.