Hi there, I wanted to know if there was a way you could enable a part of my site at a point in time and disable it after that time has past, is there anyway to code for that. For example I'm doing a project on online voting and I want the users to be allowed to register all the time but they may be only allowed to vote on election day and then they should not be allowed to vote again and/or if election day is over. If you have any ideas on different ways to do this, your help will be greatly appreciated. Im coding in c# on Visual Studio 2013

Recommended Answers

All 5 Replies

Yes, you can do that. The controller that delivers your page can check the date and either deliver the voting page or an error page depending on whether the date falls into range of your voting period.

Oh thanks for your help, I will try it out and get back to you if I have any problems

Is this an MVC or Forms page?

Wrap it in an if then clause, checking a date?, then have a seperate panel with a message on why its not available. How are you going to stop them from voting twice? Coookies can be deleted ... a login page would be the only way, but even that can bve side stepped if you don't verify the user.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.