Solved

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

Posted on 2011-09-16
6
425 Views
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 ?
0
Comment
Question by:LelloLello
  • 4
6 Comments
 

Author Comment

by:LelloLello
ID: 36549535
0
 
LVL 16

Accepted Solution

by:
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:

source:http://stackoverflow.com/questions/1987418/asp-net-is-there-a-better-way-to-find-controls-that-are-within-other-controls

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

0
 

Author Comment

by:LelloLello
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
0
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.

 

Author Comment

by:LelloLello
ID: 36550033
how can u fix that ?

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

Assisted Solution

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

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

Author Comment

by:LelloLello
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>
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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

912 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

24 Experts available now in Live!

Get 1:1 Help Now