Solved

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

Posted on 2007-03-21
3
1,431 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
[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
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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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