?
Solved

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

Posted on 2003-11-27
2
Medium Priority
?
987 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
atomicchip earned 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

719 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