Solved

Use a button to reset counter

Posted on 2009-07-10
11
321 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
Comment Utility
Welcome to the problems of web development!
Tell me more about your application in general.
0
 

Author Comment

by:ratkinso666
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:ratkinso666
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

10 Experts available now in Live!

Get 1:1 Help Now