<asp:Label id="searchInstructions" for="TextBox" runat="server">Label</asp:Label></P>

Posted on 2011-09-16
Last Modified: 2012-05-12
Hi Expert,

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
using CCFA.Utilities;
using Sitecore.Data.Items;
using CCFA.LuceneUtils;
using System.Data.SqlClient;

protected System.Web.UI.WebControls.Label searchInstructions;

On my Pages the following
searchInstructions.Text = "Artist Name:";
searchInstructions.Text = "Nom de l'artiste:";

is not displaying, It is displaying Label instead of the .text

<asp:Label id="searchInstructions" for="TextBox" runat="server">Label</asp:Label></P>

Why ?
Question by:LelloLello
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
  • 4
LVL 16

Accepted Solution

disrupt earned 250 total points
ID: 36549581
Sometimes when you have controls nested in other controls it is difficult to get a handle on them unless you have a recursive method:


try the code below pass the control and id to it and change the value that way.
public static Control DeepFindControl(Control c, string id)
   if (c.ID == id)
     return c;
   if (c.HasControls)
      Control temp;
      foreach (var subcontrol in c.Controls)
          temp = DeepFindControl(subcontrol, id);
          if (temp != null)
              return temp; 
   return null;

Open in new window


Author Comment

ID: 36549715
Well, i'm able to show the button menu.gif  on the English  and the button on the french.

Could you please tell me in my code how to fix that label for me in my code how i can show it ?

<asp:Label id="searchInstructions" for="TextBox" runat="server">Label</asp:Label></P>

Please open attached file. english image english image english image french site
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 36550033
how can u fix that ?

<asp:Label id="searchInstructions" for="TextBox" runat="server">Label</asp:Label></P> ???
LVL 12

Assisted Solution

jagssidurala earned 250 total points
ID: 36551352
Remove below code in .cs file

protected System.Web.UI.WebControls.Label searchInstructions;

Author Comment

ID: 36561045
I remove below the code didn't change anything...

 protected void Page_Load(object sender, EventArgs e)
            // english Category
            searchInstructions.Text = "Artist Name:";

            // Set Go Button
            _ibtGo.ImageUrl = "/common/artbank/images/misc/button_go_grey-e.gif";


            if (Sitecore.Context.Language.ToString() == "fr")
                // french Categorie
                searchInstructions.Text = "Nom de l'artiste:";
                _ibtGo.ImageUrl = "/common/artbank/images/misc/button_go_grey-f.gif";

The value of searchinstructions is not displaying ?  please advice.

<asp:Label id="searchInstructions" for="TextBox" runat="server"></asp:Label></P>

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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.
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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

726 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