Solved

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

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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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