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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:35:52+00:00 2026-06-18T04:35:52+00:00

I have an asp.net listview with a column that contains 2 buttons, a textbox

  • 0

I have an asp.net listview with a column that contains 2 buttons, a textbox and label.

When a button is clicked a javascript function is executed.

This function takes the value in the textbox and then starts a count down in the label.

Problem is, no matter what row I select, it takes the value from first row of the listview and sets the label in the first row of the listview also.

I have made dozens of attempts to get this to work, but can’t get it to use the right row.

How can I make sure it gets and sets the correct values?

Thank you

function countdown() {
      interval = setInterval(function () {
          var lbl = document.getElementById("ctl00_ContentPlaceHolder1_lstViewFormulas_ctrl0_lblCountDown");
          var txt = document.getElementById("ctl00_ContentPlaceHolder1_lstViewFormulas_ctrl0_txtTimeMinutes");


  <asp:Button ID="buttStartTimer" runat="server" OnClientClick="javascript:countdown()" Text="Start" />
  <asp:Button ID="buttStopTimer" runat="server" OnClientClick="javascript:stopcountdown()" Text="Stop" />
  <asp:TextBox runat="server" ID="txtTimeMinutes" Text='<%#Eval("FormulaTiming")%>'></asp:TextBox>
  <asp:Label ID="lblCountDown" runat="server" Text=""></asp:Label>

Other Attempts

  <%--<input type="button" onclick='countdown()'; value="Start" id="Start" />
  <input type="button" onclick='stopcountdown()'; value="Stop" id="Stop" />--%>
  <%--<input type="button" onclick='countdown(this.form.TimeMinutes, this.form.spCountDown)'; value="Start" id="Start" />
   <input type="button" onclick='stopcountdown()'; value="Stop" id="Stop" />--%>
  <%-- <input type="button" onclick='<%# Eval("FormulaTiming", "countdown({0});")%>' value="Start" id="Button2" />
  <input type="button" onclick='stopcountdown()'; value="Stop" id="Button3" />--%>
  <%--<input type="text" value='<%#Eval("FormulaTiming")%>' id="txtTimeMinutes" />--%>
  • 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-06-18T04:35:54+00:00Added an answer on June 18, 2026 at 4:35 am

    Could you use jquery instead:

    Give all of the buttons a class and then use jquery to find that class:

    $(".myButtonClass").click(function() {
        var buttonID = $(this).attr('id');
        var listViewRowID = buttonID.substring(buttonID.lastIndexOf('_') + 1);
        updateLabel("ctl00_ContentPlaceHolder1_lstViewFormulas_ctr"+listViewRowID+"_lblCountDown")
    }
    

    Then just write your updateLabel command to update the input label

    Please note, this has not been tested (just off the top of my head)

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

Sidebar

Related Questions

I have an asp.net listview with a column that contains, 2 input type =
I have an asp.net ListView that is sortable. I have a button with a
In Asp.net I have a listview that has a column called Amount. Negative numbers
I have a ListView in ASP.NET where one column consists checkBoxes. I want the
I want to add several buttons to a asp.net listview column for processing. Admin
I have an asp.net listview control with a asp:button in its itemtemplate . I
I'm working on a ASP.NET web forms application. I have a four-column listview, bound
In my asp.net page I have a listview that has a datapager defined in
I have an asp.net listview. The data that populates it is sorted into groups,
I have a asp.net Listview that is generating extra elements, good thing is the

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.