Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone!
I am making a voting system in which i want to keeo registration page active for certain amount of time but after the deadline i want that no-one can register on that page if somebody access it then the system display msg that registrationj date has passed.
Posted

Create a column like date/flag in database. For example, you have a field(IsRegistrationClosed) in Settings table. By default it'll be No, when you update that column with value Yes (manually/automatically) it'll prevent new registrations.

Check the value while creating new registrations. That's it. Do customize.
C#
public bool IsRegistrationClosed()
{
     //Database related code
     //Code returns the Registration flag
}

C#
public void btnRegistration_Click(Object sender, EventArgs e)
{
   if(IsRegistrationClosed())
   {
     lblStatus.Text = "Registration Closed";
   }
   {
      //Registration related code
   }
}
 
Share this answer
 
Get Registration Deadline Date from Database on the Registration Page Load and compare with the Current Date.
If Current Date is greater, then show the message.
 
Share this answer
 
v2

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