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

  • SEARCH
  • Home
  • 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 6356961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:04:20+00:00 2026-05-24T23:04:20+00:00

I have this label inside a repeater <asp:Label id=lblsub runat=server text=sdds /> I am

  • 0

I have this label inside a repeater

<asp:Label id="lblsub" runat=server text="sdds" />

I am trying to change the text of this label,this is the code behind

 For Each Item As RepeaterItem In dg.Items
    Dim l As New label
        l = CType(Item.FindControl("lblsub"), System.Web.UI.WebControls.Label)
        l.text="test"
    Next 

unfortunately this code doesn’t work for me ,the text value doesn’t change ,so I will be very happy to some help here

thanks

  • 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-24T23:04:21+00:00Added an answer on May 24, 2026 at 11:04 pm

    See my answer in this question. Believe it will solve your issue.

    Getting the databound value from repeater control in asp.net

    EDIT

    First of all, make sure you always use quotes in your markup:

    <asp:Label ID="lblsub" runat="server" Text="sdds" />
    

    Try something like this in your code behind. Forgive me if my VB is a little rusty:

    For Each Item As RepeaterItem in dg.Items
        Dim l As Label = CType(Item.FindControl("lblsub"), Label)
        l.Text = "test"
    Next
    

    There were just a couple little problems with syntax. I don’t know if they are causing your issue, but best get the easy stuff out of the way first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this label control in my web page <asp:Label ID=Label1 runat=server Text=test></asp:Label> And
I have an application with star rating. Star rating inside repeater. <asp:Repeater ID=reptweet runat=server
Suppose to have a code like this: <div class=notSelected> <label>Name <input type=text name=name id=name
Ok, I have a label, inside this label is a div, which contains an
I have a label on my asp.net page, it looks like this: more info
I have some troubles with positioning my label/password field. With this code they both
I have asp:Table with number of asp:Label inside asp:FormView , it represents short stats
i have this code <tr> <td width=300> <label for=tag>Model</label> </td> <td> <td width=10>:</td> </td>
If I have a label inside an itemtemplate of a repeater, the label is
i have this crazy label for each time i create a migration that use

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.