<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
  • 4

Author Comment

ID: 36549535
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!


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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Binding a check box in an DataGrid 4 27
Hide Tab Page 3 20
cs.Designer Issue 2 19
XML & .net 5 21
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

759 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

18 Experts available now in Live!

Get 1:1 Help Now