Solved

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

Posted on 2007-03-21
3
1,411 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
ID: 18764985
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
ID: 18765312
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
ID: 18765572
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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!
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

777 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