Solved

C#: field validation: "does not contain a definition for 'Requiredfieldvalidator3'" ?

Posted on 2003-11-27
2
971 Views
Last Modified: 2008-02-07
Hoi all...
I have the following working code:
-----------------------------
<form id="Form1" method="post" runat="server">
<asp:ValidationSummary runat="server" HeaderText="Please correct the following errors:" ShowSummary="true"
      DisplayMode="BulletList" ID="Validationsummary1" />

Variable name:
<!--StartFragment -->
<asp:RequiredFieldValidator ControlToValidate="variableName" runat="server" ErrorMessage="Please enter a name for the variable." id="RequiredFieldValidator1">
      Enter a name for the variable.
</asp:RequiredFieldValidator>
<input id="variableName" style="WIDTH: 640px" type="text" runat="server"><br>
<br>
English:
<asp:RequiredFieldValidator ControlToValidate="txtEnglish" runat="server" ErrorMessage="English text is missing." id="Requiredfieldvalidator2">
      Please enter an english text.
</asp:requiredfieldvalidator><br>
<input type="text" id="txtEnglish" runat="server" style="WIDTH:640px" NAME="txtEnglish"><br>
<br>
<asp:button id="Button1" style="" runat="server" Text="Save" Width="144px"></asp:button>

</form>
-----------------------------


This works as it should.
If I add a new field with validation i get the error message:
"'ASP.multiLanguageEditVariable_aspx' does not contain a definition for 'Requiredfieldvalidator3'"

This is the new (and broken) code:


-----------------------------
<form id="Form1" method="post" runat="server">
<asp:ValidationSummary runat="server" HeaderText="Please correct the following errors:" ShowSummary="true"
      DisplayMode="BulletList" ID="Validationsummary1" />

Variable name:
<!--StartFragment -->
<asp:RequiredFieldValidator ControlToValidate="variableName" runat="server" ErrorMessage="Please enter a name for the variable." id="RequiredFieldValidator1">
      Enter a name for the variable.
</asp:RequiredFieldValidator>
<input id="variableName" style="WIDTH: 640px" type="text" runat="server"><br>
<br>
English:
<asp:RequiredFieldValidator ControlToValidate="txtEnglish" runat="server" ErrorMessage="English text is missing." id="Requiredfieldvalidator2">
      Please enter an english text.
</asp:requiredfieldvalidator><br>
<input type="text" id="txtEnglish" runat="server" style="WIDTH:640px" NAME="txtEnglish"><br>
<br>
German:
<asp:RequiredFieldValidator ControlToValidate="txtGerman" runat="server" ErrorMessage="German translation is missing." id="Requiredfieldvalidator3">
      Please enter a translation.
</asp:requiredfieldvalidator><br>
<input type="text" id="txtGerman" runat="server" style="WIDTH:640px" NAME="txtGerman"><br>
<br>
<asp:button id="Button1" style="" runat="server" Text="Save" Width="144px"></asp:button>

</form>
0
Comment
Question by:Smoerble
2 Comments
 

Accepted Solution

by:
atomicchip earned 125 total points
ID: 9832453
It looks like your RequiredFieldValidator3 (or is it Requiredfieldvalidator3 - as shown in your error) is not referenced properly in the code-behind. Check to make sure that there is a protected object named Requiredfieldvalidator3 declared in the code-behind. Also, make sure that the case used in the code-behind matches the case used in the aspx page.

Hope that helps,
DB
0
 

Author Comment

by:Smoerble
ID: 9836619
Yes, it helped, thank you.
125 credits for you :)
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question