Solved

Use a button to reset counter

Posted on 2009-07-10
11
324 Views
Last Modified: 2013-11-26
Hi all, I need to have a button that will reset a counter, I need both the button and the counter in the grid, so there will be like 6 of them running at a time, like you would see in an auction.  So when the person pushes the button, it needs to reset the counter, not only for the person who pushed the button, but for anyone else looking at the grid.  I'm not sure how to do all of this??  I can make a simple button and counter that gets reset by it, but not sure how to put it in the grid and would it have to be server side, so that it can update the counter for anyone else looking at it??  I am using VS 2008 VB, do I have to do it in JavaScript or what, do I have to have the computers on the website refresh once a second, so they can keep up with the counters?? really not sure which direction I need to head on this.

Thanks,
Randy
0
Comment
Question by:ratkinso666
  • 6
  • 4
11 Comments
 
LVL 19

Expert Comment

by:daveamour
ID: 24823783
Welcome to the problems of web development!
Tell me more about your application in general.
0
 

Author Comment

by:ratkinso666
ID: 24823915
Well, I, perhaps foolishly, told my church that I thought I could help them setup an online auction, I have most of it figured out, but when it comes to the button, I can track WHO is placing the bid, WHAT they bid on, etc, etc., but not sure how to add a timer and make it so that I have the auction timer reset when the button is pressed and so that anyone on the auction sees it reset.  I have everything in a Datalist currently.  
Thank you for any help you can give!!
0
 
LVL 15

Expert Comment

by:spprivate
ID: 24825863
Foremost simple solution would be like in ebay or stock ticker sites.
Refresh the page and read the counter from database.
Other option is to go for Ajax where the user doesnt realized that there is a server processing.AJAX is the hot one  to look for
0
 

Author Comment

by:ratkinso666
ID: 24826174
I would like to do it in AJAX, but not sure how to start it out??  AJAX doesn't have a timer, so not sure how I would set that in the database so that I could read it into my gridview....  and have like 6 independent ones...
0
 
LVL 15

Accepted Solution

by:
spprivate earned 500 total points
ID: 24826463
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:ratkinso666
ID: 24826943
Thank you spprivate, that does tell me how to refresh my grid every second, so that the current time remaining displays.  But is the timer supposed to display the time remaining, I don't see how it does, from what I can see, is all it will do is refresh my update panel, which is useful, but still doesn't show a timer.  I can see that I could create fields in my database for hours, minutes and seconds and refresh those in a label maybe??  To show the countdown...  Is that what I would need to do and then that therefore would display a timer, not sure if that is the best way to do, since that would be a LOT of refreshing and traffic.  If that is how I would do it, then how would I make the time update in the database?  Hope that makes sense...

Thank you VERY much
0
 
LVL 15

Expert Comment

by:spprivate
ID: 24827369
You want to show a timer or ticking clock kind of thing in the page to all the users.that should be reset once a button is clicked.Correct
0
 

Author Comment

by:ratkinso666
ID: 24827391
yes, that is correct, in a grid for each item, so I could have 6 different clocks running at the same time, but only one at a time gets reset.
0
 
LVL 15

Expert Comment

by:spprivate
ID: 24827474
Here is an example of timer control in ajax

http://www.codeproject.com/KB/webforms/ServerSideClock.aspx

Here if you look in the last part

"Setting logick on Tick event Here we dont have to do much. just set current date time value to label void timer_Tick(object sender, EventArgs e)"

Where he sets the time,read the time from the database table.
The reset button in the control form would update that table everytime when reset button in clicked
0
 

Author Comment

by:ratkinso666
ID: 24828220
I will work on it with the info you gave me, but it will take me some time and experimenting to figure out how that is working.
Thanks
0
 

Author Comment

by:ratkinso666
ID: 24830782
I've been working with this, but unless I am just not getting it correct, which is VERY possible, it only seems to do time, rather than a timer...  I need something that is set to like say 3:00 minutes and starts counting down, unless someone hits the bid button and then it will add like 30 seconds to whatever time is remaining.  I can set up the hours, minutes and seconds in the database, but then unless someone hits the button it will not change, so I need to be able to change the time in the database even when no one is hitting any buttons..  hope that makes sense...  I know it can be done I have seen it on other sites, just not sure how...

thanks,
randy
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Closing all open child forms. 4 38
How to save a picture box in a specific network folder using vb.net 2013 7 26
Syntax Error 2 45
Visual Studio 2015 Source Code Control 10 34
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now