Solved

Unable to find control with id 'txtUserName' that is associated with the Label 'lblEmail'

Posted on 2007-03-21
3
1,381 Views
Last Modified: 2012-08-14
Hi
Has anyone come across this problem, i'm adding localization to the webpages and when adding the meta:resourcekey to the label control with a AssociatedControlID="txtUserName" it throws this error:

Unable to find control with id 'txtUserName' that is associated with the Label 'lblEmail'.

Here is the code:
<asp:Label ID="lblEmail" AssociatedControlID="txtUserName"
                    runat="server" meta:resourcekey="lblEmail" >
                    <asp:TextBox ID="txtUserName" runat="server" AccessKey="1" TabIndex="1"
                        Columns="45" MaxLength="150" SkinID="sknTextBox" ValidationGroup="Step1"
                        ToolTip="Enter Email Address" ></asp:TextBox>
                                   </asp:Label>

Remove AssociatedControlID="txtUserName" and works as expected

Resource file

lblEmail.Text  value is Email

Any help would be appreciated
George
0
Comment
Question by:LearningCSharpSQL
3 Comments
 
LVL 28

Accepted Solution

by:
mmarinov earned 500 total points
Comment Utility
Have you tried this

<asp:Label ID="lblEmail" AssociatedControlID="txtUserName"
                    runat="server" meta:resourcekey="lblEmail" />
                    <asp:TextBox ID="txtUserName" runat="server" AccessKey="1" TabIndex="1"
                        Columns="45" MaxLength="150" SkinID="sknTextBox" ValidationGroup="Step1"
                        ToolTip="Enter Email Address" ></asp:TextBox>

Regards
Martin
0
 
LVL 4

Expert Comment

by:Neotk
Comment Utility
try this:
<asp:Label ID="lblEmail" AssociatedControlID="txtUserName"
                    runat="server" meta:resourcekey="lblEmail" >
                    <asp:TextBox ID="txtUserName" runat="server" AccessKey="1" TabIndex="1"
                        Columns="45" MaxLength="150" SkinID="sknTextBox" ValidationGroup="Step1"
                        ToolTip="Enter Email Address" resourcekey="txtUserName" AssociatedControlID="lblEmail" ></asp:TextBox>
                                   </asp:Label>

but your code worked for me...
0
 

Author Comment

by:LearningCSharpSQL
Comment Utility
Hi Neotk

Not sure how it worked for you as i cannot get it to work on my end.

Hi mmarinov
Did not thing of doing that :-(

Thanks both of you for taking time to reply.
George
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now