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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:35:48+00:00 2026-05-19T00:35:48+00:00

I need to get the value of the CommandArgument attribute of a LinkButton, in

  • 0

I need to get the value of the CommandArgument attribute of a LinkButton, in an asp:Repeater.

I have an asp:Repeater with 2 LinkButtons whose CommandArgument I set to a value:

<ItemTemplate>
    <tr class="odd">                                        
        <td><%#DataBinder.Eval(Container.DataItem, "batch_id")%></td>
        <td><%#DataBinder.Eval(Container.DataItem, "productId")%></td>
        <td><%#DataBinder.Eval(Container.DataItem, "serial_number")%></td>
        <td><%#DataBinder.Eval(Container.DataItem, "activation_card_number")%></td>
        <td><%#DataBinder.Eval(Container.DataItem, "transaction_amount","{0:C}")%></td>                                        
        <td><%#DataBinder.Eval(Container.DataItem, "response_dt", "{0:M/d/yyyy HH:mm:ss}")%></td>                                        
        <td style="text-align:center;"><%#DataBinder.Eval(Container.DataItem, "resp_process_msg")%></td>
        <td style="text-align:center;"><%#DataBinder.Eval(Container.DataItem, "resp_response_code")%></td>
        <td style="text-align:center;"><asp:LinkButton ID="lnkBtnRestageAdd" CommandName="Add" CommandArgument='<%#Eval("activation_card_number")%>' runat="server" Text="stage" class="add" OnClientClick="return false;" /></td>                                                                                
        <td style="text-align:center;"><asp:LinkButton ID="lnkBtnRestageMinus" CommandName="Subtract" CommandArgument='<%#Eval("activation_card_number")%>' runat="server" Text="stage" class="minus" OnClientClick="return false;" /></td>
      </tr>
</ItemTemplate>

I have suppressed the PostBack with OnClientClick=”return false;” so that I can pop a jQuery dialog modal when the link buttons get clicked:

if (btnAdd != null) {
    $(".add").click(function() {
        $("#<%=divDialogAdd.ClientID %>").removeAttr("style");
        $("#<%=divDialogAdd.ClientID %>").dialog("open");
    });
}

In the modal I have 2 other asp:LinkButtons, and when the ‘Yes’ button is clicked I do the postback like so:

yesBtn.click(function() {
    setTimeout('__doPostBack(\'btnAdd\',\'\')', 0); //need to add a param
});

What I need to do, is somehow grab the CommandArgument value from the LinkButton in the Repeater, so that I can pass that as a parametere or assign it to a hidden field. I have tried jQuery’s attr(), but that only works when the attribute was set using that function as well. How can I get this value, or what other way can I go about this?

  • 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-19T00:35:49+00:00Added an answer on May 19, 2026 at 12:35 am

    I don’t think you can get that property in javascript. Because the command argument is passed as the the argument in the doPostBack function. But i think you can change your code like this to decrease the complexity.

    <asp:LinkButton ID="lnkBtnRestageAdd" 
                    CommandName="Add" 
                    CommandArgument='<%#Eval("activation_card_number")%>' 
                    runat="server" 
                    Text="stage" 
                    class="add" 
                    OnClientClick='<%#Eval("activation_card_number","javascript:return YourFunction({0});")%>' />
    

    do the stuff that you want to do in the function YourFunction return true if Yes is pressed and return false

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

Sidebar

Related Questions

I need to get attribute value of clicked element, but I have an ajax
I need to get string value from WPF Window class? For example I have
For example i have this xml. I need to get value of parameter val
I have two tables with a weak relation. I need get a text value
I have a ModalPopup in the ItemTemplate of a GridView like <ItemTemplate> <asp:LinkButton ID=lnkbtnSeek
I have two combobox. I need get some value from first combobox1 after combobox1
I have a piece of software, which is obfuscated. I need to get value
I need to get value from a href button. Here I have just developed
I have a DetailsView, I need get the value specifield in DataKeyNames UserId (a
I need to get the value of the content attribute of a certain meta

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.