Friday, July 17, 2009

checking if a sharepoint list exists or not

One of the major problem is sharepoint object model is handeling lists....
what to do is a list does not exist??
Once we needed to write a code that would rename a list if it exists...now to do that we neede to put the
web.lists["listname"] in try catch block....doing it again and again is really a pain...
i read this cool way of writing extension methods.on Bill's (a MVP) blog...
wat it will eseesntially do is ,it will create an extension method through which you could check something like
 
if(web.ListExists("liastname"))
 
 
have a look...simple but a pretty good idea..
thanks bill
 

No comments:

Post a Comment