Here is is the code to check this
Sol 1:
if (pPage.ListItem.File.CheckOutType == SPFile.SPCheckOutType.None)
pPage.CheckOut();
Sol 2:
SPFile fileSource = web.GetFile(strSourceFilePath);
SPUser user = null;
user = fileSource.CheckedOutBy;
if (user != null)
{....
If we does not check so then we may get error that page is already checked out.
No comments:
Post a Comment