1.

How to delete sitepage and check exists or not in sharepoint

Answer»

Below is the code for CHECK FILE is-EXISTS or not if exists then delete the file


SPWeb site=SPContext.Current.Web;
SPFIle sitePage=site.GetFile("filename.aspx")
if(sitePage.Exists)
{
sitePage.Delete();
}



Discussion

No Comment Found