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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:39:29+00:00 2026-05-18T07:39:29+00:00

This is my repeater: <asp:Repeater ID=myRepeater OnItemCommand=myRepeater_ItemCommand runat=server OnItemDataBound=myRepeater_OnItemDataBound> <HeaderTemplate> <table width=99% border=0 cellpadding=0

  • 0

This is my repeater:

<asp:Repeater ID="myRepeater" OnItemCommand="myRepeater_ItemCommand" runat="server" OnItemDataBound="myRepeater_OnItemDataBound">
     <HeaderTemplate>
         <table width="99%" border="0" cellpadding="0" cellspacing="0">
             <tr class="lgrey">
                <td>Default</td>
             </tr>
     </HeaderTemplate>
     <ItemTemplate>
         <table>
             <tr>
                <td>
                    <asp:LinkButton ID="lnk1" Text="Make Default" CommandName="SetDefault" runat="server" Visible="True" CommandArgument='<%#Eval("UserID") %>' CausesValidation="false"></asp:LinkButton>
                    <asp:Label ID="label1" Text="Yes" runat="server" Visible="False"></asp:Label>
                </td>
             </tr>
     </ItemTemplate>
     <FooterTemplate>
         </table>
     </FooterTemplate>
</asp:Repeater>

What I want is that when user clicks on any of
the “lnk1” link button in the list that repeater renders,
the link should be replaced with the label “label1”..
i.e. when the user clicks on “Make Default” link, it should be replaced with “Yes” label

Calling this method obj.SetDefaultAddress(); is setting the default address in the DB alright..
problem is with the display of the label1 and lnk1 when the repeater renders…

what is happening is that BOTH “Make Default” LinkButton and the “YES” label are getting displayed
under the “Default” column of the table inside my repeater.

I want some code that will check the “IsDefault” value in my DB and display “Make Default ” link button

and “YES” label accordingly… i.e. if IsDefault’s value in the DB is TRUE then “YES” should be displayed in the repeater
otherwise “Make Default”

  • 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-18T07:39:29+00:00Added an answer on May 18, 2026 at 7:39 am

    Are you sure your piece of code in code behind under ItemCommand is executing?
    I only changed the CommandName from SetDefault to SetDefaultAddress in aspx file to match with the one in code behind, it worked.

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

Sidebar

Related Questions

There's this repeater... <asp:Repeater ID=myRepeater OnItemCommand=rpt1_ItemCommand runat=server OnItemDataBound=rpt1_OnItemDataBound> <HeaderTemplate> <table width=99% border=0 cellpadding=0 cellspacing=0>
Okay so I have a repeater: <asp:Repeater ID=myRepeater OnItemDataBound=myRepeater_ItemDataBound runat=server> <HeaderTemplate> </HeaderTemplate> <ItemTemplate> <sc:sublayout
I have a table that looks something like this: <asp:Repeater ID=myRepeater runat=server> <div id=divTable
Assuming I have the following repeater. <asp:Repeater ID=MyRepeater runat=server onitemdatabound=MyRepeater_ItemDataBound> <FooterTemplate> </table> <asp:Button ID=btnPrevious
I have a repeater like this: <asp:Repeater runat=server ID=pde> <HeaderTemplate></HeaderTemplate> <ItemTemplate> <asp:Literal runat=server ID=literal1></asp:Literal>
I have this repeater: <asp:Repeater ID=rptContentPageGetAll runat=server OnLoad=rptContentPagesGetAll_Load> <HeaderTemplate> <ul class=contentPageTree> </HeaderTemplate> <ItemTemplate> <li><%#
I would like to do something like this in ASP.Net 2.0: <asp:Repeater id=myRepeater runat=server>
I have my repeater item template: <asp:Repeater ID=Linksrepeater runat=server> <HeaderTemplate><h2>Links</h2><ul> </HeaderTemplate> <ItemTemplate> <li><%#Container.DataItem(Category)%></li> </ItemTemplate>
I have a DIV inside my repeater as follows: <asp:Repeater ID=topicView runat=server OnItemCommand=Delete_ItemCommand> <ItemTemplate>
This is my repeater control in my .aspx page: <asp:Repeater ID=rptEvents runat=server> <ItemTemplate> <div><asp:HyperLink

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.