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 5945857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:44:26+00:00 2026-05-22T16:44:26+00:00

I have a label and dropdownlist inside a repeater . When I click a

  • 0

I have a label and dropdownlist inside a repeater. When I click a button outside the repeater I would like to access the label.Text value and ddl.SelectedIndex value.

<asp:Repeater ID="rptProduct" runat="server" DataSourceID="objdsProduct" OnItemCommand="rptProduct">
   <ItemTemplate>
   <div>
      <div>
         <asp:Label ID="lblProdName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
      </div>
      <div>
         <asp:DropDownList ID="ddlSize" runat="server" AutoPostBack="False" DataSourceID="objdsSize"  DataTextField="SizeName" AppendDataBoundItems="True" DataValueField="SizeID">
            <asp:ListItem Text="select a size" Value=0></asp:ListItem>
         </asp:DropDownList>
   </div>
   </ItemTemplate>
</asp:Repeater>

<asp:Button ID="btnChoose" runat="server" Text="Choose Products" />

Any suggestions how I can access lblProdName.Text and ddlSize.SelectedValue within:

Protected Sub btnChoose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnChoose.Click

   Dim ProductName
   Dim Size

End Sub

Thank you for your time.

  • 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-22T16:44:27+00:00Added an answer on May 22, 2026 at 4:44 pm

    Add this to your button click:

    Dim item As RepeaterItem
    For Each item In  rptProduct.Items
        Dim ProductName As String = DirectCast(item.FindControl("lblProdName"), Label).Text   
    Dim Size As Integer = (DirectCast(item.FindControl("ddlSize"), DropDownList).SelectedValue
    Next item
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following XML: <DropDownList id=Dropdown> <Label text=Dropdown/> <ListItem value=Test1/> <ListItem value=Test2/> </DropDownList>
I have small page which has label, DropDownList and a submit button. <div> <asp:label
I have the webform with dropdown list, label and textbox. Like below: <asp:DropDownList ID=ddlTest
I'm using a repeater ListOfArticles and have controls inside it like ddlSizes and btnSelectArticle
I have a label function like : private function formatDate (item:Object, column:DataGridColumn):String { var
I have this label control in my web page <asp:Label ID=Label1 runat=server Text=test></asp:Label> And
i have a label in my form, and im trying to get the value
I have a label on my asp.net page, it looks like this: more info
I have a label that is using a repeater to get information form a
I have created a label and a dropdownlist. The label has the dropdownlist as

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.