Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

15 Experts available now in Live!

Get 1:1 Help Now