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

I have a sharepoint 2010 site and I want it to be accessed between two dates (the 1 and 6 of each month).I know that the solution can be created with timer job but i'm beginner in c#.
is there anyone have a c# code to do that?

thanks before.
Posted
Updated 23-Apr-12 2:52am
v2
Comments
Sandeep Mewara 23-Apr-12 8:54am    
Though you are a beginner, did you try anything ? Asking for direct code without making/showing an effort is not encouraged here.

1 solution

A timer job will not help for this requirement. A SharePoint site is an ASP.NET site and you can't limit access to the site itself on certain days. IIS will server the request no matter what the date is.

The simplest solution may be to add a webpart, or server control, to the default page that triggers a redirect during the periods the site is not accessible. There are other more complex ways, such as creating a custom HTTPModule or removing access to the site, but really SharePoint and ASP.NET applications were not really meant to be used this way.
 
Share this answer
 

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