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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:18:12+00:00 2026-05-26T02:18:12+00:00

I have a Linkbutton inside a Repeater control. My code in the aspx page

  • 0

I have a Linkbutton inside a Repeater control.
My code in the aspx page :

    <asp:LinkButton ID="lnkBtnOpenSuplmnt" runat="server"  
 Text= "OpensupLink"
 OnClientClick='<%# Eval("ClaimId", "return confirm(\"Reopen the assignment for claim {0} to issue a supplement?\")" ) %>'
    OnClick ='<%# lnk_OpenSupplement(Eval("ClaimId"))%>'> 
</asp:LinkButton>

Then on the code behind

protected string lnk_OpenSupplement(object profileId)
        {
            string retStr = "success";
                  .........
            return retStr;

        }

In the page_load :

  repeater.DataSource = recentAssignments;
                    repeater.DataBind();

The strange thing happening here is : in the Repeator’s databind the lnk_OpenSupplement method gets fired, which is unwanted functionality. How can i avoid this. or can some body point out where am I going wrong.

Thanks in advance

BB

  • 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-26T02:18:13+00:00Added an answer on May 26, 2026 at 2:18 am

    You’re databinding the output of that method to the OnClick event.

    Meaning, you’re saying OnClick = "success", which isn’t what you’re expecting to happen.

    <%# something %> means ‘Execute something when binding this element and use the return value here’.

    I’d recommend you take a look at how to bind command arguments to the ItemCommand event.

    Here are some articles that describe how to do this:

    http://ondotnet.com/pub/a/dotnet/2003/03/03/repeater.html

    http://www.asp.net/data-access/tutorials/custom-buttons-in-the-datalist-and-repeater-vb

    After hooking up the event, your button would then become:

     <asp:LinkButton ID="lnkBtnOpenSuplmnt" runat="server"  
          Text= "OpensupLink"
          OnClientClick='<%# Eval("ClaimId", "return confirm(\"Reopen the assignment for claim {0} to issue a supplement?\")" ) %>' 
          CommandName="MyCommand" 
          CommandArgument='<%# Eval("ClaimId") %>'>
    </asp:LinkButton>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp:LinkButton as follows: <asp:LinkButton ID=LinkButtonNewServicesCategory runat=server OnClientClick=this.disabled=true;return false; style=float:left;margin-right:5px; CausesValidation=False>new services
I have an ASP.NET linkbutton control on my form. I would like to use
I have a user control with linkbuttons (used for paging) and a repeater inside
I have a Linkbutton inside a repeater and I want to delete the Item
i have a aspx page in which i have placeholder inside the panel as
i have Linkbutton inside updatePanel and when i click on it it returns following
how can i use request.querystring in asp.net.i have a linkbutton and this is in
I have a usercontrol that hides a div when a button is clicked. <asp:LinkButton
I have some updatepanels in asp.net page. I want updatepanel 2 get refreshed when
I've an item template inside a grid which has a <asp:LinkButton/> inside it. I

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.