My Site configuration looks like this:
<site name="sitename" patch:after="site[@name='web_module'] targetHostName="HostName"
database="web"
virtualFolder="/"
physicalFolder="/"
rootPath="RootPath"
startItem="/Home"
dictionaryPath="DictionaryPath"
dictionaryAutoCreate="false"
placeholderSettingsRoot="PlaceholderSettingsRootPath"
domain="extranet"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="50MB"
registryCacheSize="0"
viewStateCacheSize="0"
xslCacheSize="25MB"
filteredItemsCacheSize="10MB"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
disableClientData="false"
cacheRenderingParameters="true"
renderingParametersCacheSize="10MB"
formsRoot="formsRootGUID"
loginPage="/login"
enableItemLanguageFallback="true" />
However if I use the Sitecore.Context.Database
to get the context to get items, it returns master instead of web in sc_mode=normal
.
Sitecore.Data.Database context = Sitecore.Context.Database;
Why is it so and what could possibly go wrong?
Thanks!
?sc_mode=normal parameter
?Sitecore.Context.Site.Name
andSitecore.Context.Site.Properties["database"]
?/sitecore/admin/showconfig.aspx
? Else check using that and make sure you do not have the LIveMode.config enabled.