Monday, December 14, 2009

Fetching SPList object properly.

When ever we need to access a Custom List or a Document Library , we normally write like:

SPList lst = web.Lists["List Name"];

But this is a performance killer. So avoid this and modify the code to:

SPList lst = web.GetList("http://testServer/Lists/ListName");

No comments:

Post a Comment