2
Answers

Edit EditForm.aspx for all document Libraries in a site

 I have more than 50k document libraries in a site collection. 

When we upload the document and hit cancel on EditForm.aspx (Mode=Upload), it still uploads the document in checked out status. I want to overright the cancel button (not from ribbon) on EditForm.aspx to delete the document if certain fields are not filled up. How can I do it for all libraries?
 
 
Answers (2)
0
Nir Bar
NA 773 0 15y
Hi Petre,

There isn't an automatic way of doing it.
I think the best way will be to count day-by-day in a loop:
int count = 0;
for( DateTime d = dt1.Value.Date; d <= dt2.Value.Date; d = d.AddDays(1))
{

if(( d.DayOfWeek != DayOfWeek.Saturday) && (d.DayOfWeek != DayOfWeek.Sunday))
{
++count
}
}
return count


Please mark this post as an answer if it helps you

Nir