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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:28:33+00:00 2026-05-25T18:28:33+00:00

I have the following repeater code: <asp:Repeater ID=repMain runat=server OnItemCommand=repMain_ItemCommand EnableViewState=false> <ItemTemplate> <dmg:testcontrol runat=server

  • 0

I have the following repeater code:

 <asp:Repeater ID="repMain" runat="server" OnItemCommand="repMain_ItemCommand" EnableViewState="false">
    <ItemTemplate>
    <dmg:testcontrol runat="server" MyData=<%#Container.DataItem %>>


    </dmg:testcontrol>
    </ItemTemplate>
    </asp:Repeater>

The testcontrol usercontrol looks like:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TestControl.ascx.cs" Inherits="TestRepeater.TestControl" %>
<asp:Literal runat="server" ID="litMain" Text="<%#MyData.MyValue %>"></asp:Literal>
<asp:DropDownList runat="server" ID="dropdownMain"></asp:DropDownList>
<asp:Button runat="server" ID="btnMain" Text="Click Me" CommandName="Update" CommandArgument="<%#dropdownMain.SelectedValue%>"/>

Is it possible for me to send through the dropdownMain.SelectedValue as the CommandArgument?

Just now it is an empty string.

Thanks

Duncan

PS This is related to ASP.NET Repeater not binding after ItemCommand but I thought the two sufficiently different to keep apart.

  • 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-25T18:28:34+00:00Added an answer on May 25, 2026 at 6:28 pm

    A bit old question but I just my self found the answer to this one.

    CommandArgument="<%#dropdownMain.SelectedValue%>"
    

    Needs to look like this instead with single quotes! All inline codes within a asp.net controls have to be done this way instead.

    CommandArgument='<%#dropdownMain.SelectedValue%>'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following (trimmed) markup: <asp:Repeater ID=CostCategoryRepeater runat=server> <ItemTemplate> <div class=costCategory> <asp:Repeater ID=CostRepeater
In my repeater I have the following markup: <asp:Repeater runat=server id=TeamsRepeater OnItemDataBound=TeamsRepeater_ItemDataBound ClientIDMode=Predictable> <ItemTemplate>
I have an ASP page with the following repeater: <asp:Repeater runat=server ID=RegionRepeater DataSourceID=SqlDataSourceRegions EnableViewState=true>
I have the following ASPX code: <asp:ScriptManager ID=ScriptManager1 runat=server /> <asp:UpdatePanel runat=server ID=UpdatePanel UpdateMode=Conditional>
I have the following HiddenField within a Repeater labeled AdminGetAllRPT: <asp:Repeater ID=AdminGetAllRPT runat=server OnLoad=AdminGetAllRPT_Load>
I have a repeater control: <table style=width: 100%> <asp:Repeater runat=server ID=rptOptions OnItemDataBound=rptOptions_ItemDataBound> <HeaderTemplate> <tr>
I have the following structure <asp:UpdatePanel ID=MyUpdatePanel runat=server> <ContentTemplate> <asp:MultiView ID=MyViews runat=server> <asp:View ID=List
I have the following multiview set up in my aspx page: <asp:MultiView id=MultiView1 runat=server
Take following example of code: (ASP.NET WebForms) <asp:Content ContentPlaceHolderID=Contents runat=server> <div class=blogpost-list> <asp:Repeater ID=blogList
Morning stackoverflow, I have a repeater, with the following code in my aspx page;

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.