Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3335054
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:58:26+00:00 2026-05-17T23:58:26+00:00

I had Datalist and inside it panel and inside panel label and I want

  • 0

I had Datalist and inside it panel and inside panel label and I want to find label inside panel inside datalist.I did my code but it didnot work well

protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{

    Label LblHead = e.Item.FindControl("Label1") as Label;
    string LanguageID = Globals.GetSuitableLanguage(Page);

    if (LanguageID == "ar")
    {
        LblHead.Attributes.Add("CssClass", "hed_logo2");
    }
       }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:58:27+00:00Added an answer on May 17, 2026 at 11:58 pm

    This code should work, tested on my local:

    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Panel panel1 = e.Item.FindControl("Panel1") as Panel;   //assume your panel name is Panel1
            if (panel1 != null)
            {
                Label LblHead = panel1.FindControl("LblHead") as Label;
                if (LblHead != null)
                {
                    string LanguageID = Globals.GetSuitableLanguage(Page);
                    if (LanguageID == "ar")
                    {
                        LblHead.Attributes.Add("CssClass", "hed_logo2");
                    }
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had label in panel in datalist and I added code in item databound
I had datalist as menu that display categories and subs and I want to
I had ddl which in selected changed it execute some code but when i
Had this working well in Emacs 23.1.x but it appears to have broke in
I've been looking through the Java API, but have had no luck in working
i have the following method in a usercontrol protected override void Render(HtmlTextWriter writer) {
I had Drop down list which execute code when specific condition and I tried
Had to deploy some PHP code onto a shared server with only PHP5.2.8. All
Had a quick look here, couldn't find a duplicate (correct me if im wrong).
Had to deploy some PHP code onto a shared server with only PHP5.2.8. All

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.