Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

I would like to ask how can I set the button when User only able the click once for every month??

Example:
I have 1 "Add" button and 1 "Created On" column.
When user click "Add" Button, "Created On" will added one record.
but how can I set it User only able to click once for every month???

Thank you!
Posted
Updated 24-Aug-13 21:23pm
v2

1 solution

Assuming that VB.NET means this is a web based solution, there are two baisc methods: you can set a Cookie on the users computer which expires at the end of the month, and check that when you load the page - if it's there, disable the button.
The other alternative is to store the last date the button was clicked in your database with the login details and check then when you load the page.
 
Share this answer
 
Comments
Member 10230385 25-Aug-13 3:29am    
Ya, you're right....but can i have a sample code??
OriginalGriff 25-Aug-13 3:42am    
Which for?
Member 10230385 25-Aug-13 3:44am    
which is the code that how check/compare current date from Database Created on record ?
OriginalGriff 25-Aug-13 4:28am    
Assuming that you know how to read a value from a Database - and it's a pretty good assumption since you need logged in users for this to work - it's pretty easy.
Read the value into a DateTime and check it against todays date:
If dateButtonLastPressed.AddMonths(1) <= DateTime.Now Then
myButton.Enabled = True
End If
Member 10230385 25-Aug-13 7:02am    
Erm..i dun really know how read value from database actually..sorry.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900