I have a SPWeb object and I want to know whether or not this is a SearchCenter site. How can I know it programmatically. Is there some setting to check or a guid to match etc?
Asked
Active
Viewed 550 times
2 Answers
1
A SearchCenter is created from a special site template that you can identify from the WebTemplate property on the SPWeb object. It will carry the value 'SRCHCEN'.

Lars Fastrup
- 5,458
- 4
- 31
- 35
-
Thanks. However, property __WebTemplates is blank when i try to check it for a SPWeb that I know is a SearchCenter. – Feb 03 '09 at 22:33
-
Ok. This works. SpWeb.WebTemplate is a property on SPWeb directly. That shows SRCHCEN for searchcenter with pages and SRCHCENTERLITE for one without pages. Thanks – Feb 03 '09 at 22:40