I found the problem. I'm using DreamWeaver MX and it turns out that its
C#/ASP.NET code is completely out in the forest. I've taken care of the
problems manually - thanks for your help!
- J.
> It seems to work okay here. Maybe something is corrupt in your .resx file?
You
> can delete it and rebuild.
> For your reference, I've pasted in my code below.
> Ken
> 'ctv.aspx
> Inherits="p733workev.ctv"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <html>
> <head>
> <title>ctv</title>
> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema"
> content="http://www.veryComputer.com/;>
> </head>
> <body ms_positioning="FlowLayout">
> <form id="Form1" method="post" runat="server">
> Brugernavn:<br>
> <asp:textbox cssclass="aspforms" runat="server"
textmode="SingleLine"
> id="bruger" />
> <asp:requiredfieldvalidator controltovalidate="bruger"
display="Dynamic"
> errormessage="Skriv et brugernavn!"
> id="brugerVal" runat="server" />
> <br>
> Kodeord:<br>
> <asp:textbox cssclass="aspforms" id="kodeord" runat="server"
> textmode="Password" />
> <asp:requiredfieldvalidator controltovalidate="kodeord"
display="Dynamic"
> errormessage="Skriv et kodeord!" id="kodeordVal"
> runat="server" />
> <br>
> <asp:button id="logindknap" runat="server" text="Log ind" />
> <br>
> <br>
> </form>
> </body>
> </html>
> 'ctv.asp.vb
> Public Class ctv
> Inherits System.Web.UI.Page
> #Region " Web Form Designer Generated Code "
> 'This call is required by the Web Form Designer.
> <System.Diagnostics.De*StepThrough()> Private Sub
> InitializeComponent()
> End Sub
> Protected WithEvents kodeord As System.Web.UI.WebControls.TextBox
> Protected WithEvents logindknap As System.Web.UI.WebControls.Button
> Protected WithEvents brugerVal As
> System.Web.UI.WebControls.RequiredFieldValidator
> Protected WithEvents kodeordVal As
> System.Web.UI.WebControls.RequiredFieldValidator
> Protected WithEvents bruger As System.Web.UI.WebControls.TextBox
> 'NOTE: The following placeholder declaration is required by the Web
Form
> Designer.
> 'Do not delete or move it.
> Private designerPlaceholderDeclaration As System.Object
> Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Init
> 'CODEGEN: This method call is required by the Web Form Designer
> 'Do not modify it using the code editor.
> InitializeComponent()
> End Sub
> #End Region
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> End Sub
> Private Sub logindknap_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles logindknap.Click
> End Sub
> End Class
> Actually, I made an error in my original post. Initially, my code had the
ID
> value set correctly. In an attempt of debuggin I changed the ID parameter
to
> Name, and forgot to change it back when I posted this.
> Thanks for your input though. Any further advice would be great.
> - J.
> > I don't see an ID value for the first textbox. I think that's what
ASP.NET
> > wants to see (not the Name).
> > When I pasted the code into VS.NET, it added the ID value as Textbox1.
> > Does that fix it?
> > Ken
> > Hello all,
> > I'm having problems with my validation. I have two textboxes, one
> > representing user name and one representing password in a login form,
and
> > two validation controls to go with them. Problem is, the validation
> controls
> > cannot find the textboxes by ID. I get this error:
> > Unable to find control id 'bruger' referenced by the 'ControlToValidate'
> > property of 'brugerVal'.
> > Description: An unhandled exception occurred during the execution of the
> > current web request. Please review the stack trace for more information
> > about the error and where it originated in the code.
> > Exception Details: System.Web.HttpException: Unable to find control id
> > 'bruger' referenced by the 'ControlToValidate' property of 'brugerVal'.
> > This is my relevant code:
> > Brugernavn:<br /> <asp:textbox CssClass="aspforms" name="bruger"
> > runat="server" TextMode="SingleLine" /> <br />
> > Kodeord:<br /> <asp:textbox CssClass="aspforms" ID="kodeord"
> runat="server"
> > TextMode="Password" />
> > <br /> <asp:button ID="logindknap" runat="server" Text="Log ind" />
> > and
> > <asp:requiredfieldvalidator ControlToValidate="bruger" Display="Dynamic"
> > ErrorMessage="Skriv et brugernavn!" ID="brugerVal" runat="server" /> <br
> />
> > <asp:requiredfieldvalidator ControlToValidate="kodeord"
Display="Dynamic"
> > ErrorMessage="Skriv et kodeord!" ID="kodeordVal" runat="server" /> <br
/>
> > Please help me!
> > Thanks in advance,
> > J.