Skip navigation

Tag Archives: ASP.NET

Recently I was tasked with helping to integrate Sitecore into my company’s website. Currently we are using Microsoft CMS 2002, which for the most part works well. It does exactly what we need it to at this point. The problem is that it is so old, I believe the support is being dropped. Our lead content developer went through a long process of trying to find the right product for us. She finally came to the conclusion that Sitecore would work best for us.

Our website is written in 100% ASP.NET 2.0 with C#. Sitecore is an all .NET CMS, so it makes sense. We were able to get our hands on a trial product so that we could begin work on a POC. After having gone through the Sitecore documentation we realized that the way they want website setup really doesn’t play nicely with our project. They want their site to be the root, and all of your sites files to be a subfolder. This is not very practical for us because we run multiple sites on one code platform. Also, in development we generally are working on multiple branches. The sitecore files are around 300MB, and with multiple sites and branches, copying that amount of data around wouldn’t be practical.

So, a coworker and I tried many different scenarios and finally came up with a pretty good solution. What we originally had in mind was to just reference the Sitecore assemblies and set up all the configuration for Sitecore in our web.config. After we did that we ran into a couple of snags. The first thing is, even just to run their HTTPModule, you need to give their assemblies access to the sitecore install/sitecore directory. So, we created a virtual directory that pointed to sitecore install/sitecore. This virtual directory must be just a plain old virtual directory, not an application.

One issue is you need all of the assemblies from Sitecore’s bin directory, not just the Sitecore assemblies. Also, there are a couple of other required directories. Below you can see what is required, sitecore folder is a virtual directory. All the other directories were copied from the sitecore install.


sitecore (vd)



sitecore modules


Another thing worth mentioning is that the Sitecore installer doesn’t set up the configuration for your database even if you specify your database information. You have to go into the App_Config/SqlServer/Connections.config file and manually specify your connection information. In your web.config you must also make sure the connections node’s serverMode attribute is set to blank. This node can be found under the sitecore node.

In the web.config there are also a bunch of folder paths that will need to be updated. For instance, <sc.variable name=”dataFolder” value=”../data” />. Make sure these variables map to the correct paths.

After all of that, the site runs pretty well with Sitecore, and we didn’t have to change the structure of our project.


After hours of research and finding that no one else had experienced this issue, at least my form of this problem, I finally found a post somewhere. I had created a page with a single button on it and was able to click and the page would postback successfully. All is good. I had a number of textboxes on the page that were required and some that needed additional validation as well. So I threw on my RequiredFieldValidators and RegularExpressionValidators, the validators worked correct, messaging appearing correctly when data not present and disappearing when data was valid. When I clicked the submit button NOTHING happened. So I removed all of the validators and the page worked again, added one validator and posting was not possible again. The issue is that I had placed a script reference with a self closing tag. So something like this <script type=”text/javascript” src=”/js/somefile.js”/>, for whatever reason that only God can explain, this upsets the Page_ClientValidate function. Conclusion, throw out XHTML when including script files and make sure you have a closing tag <script type=”text/javascript” src=”/js/somefile.js”></script>.

Thank you again Microsoft

This is a quick one. The other day I ran into an ASP.NET error basically indicating one of my virtual directories was running as an ASP.NET 1.1 app instead of an ASP.NET 2.0 app. “Easy enough, I’ll just go ahead and change it in the IIS mmc snap-in” I thought. To my surprise, the virtual directory properties window was missing the ASP.NET tab. I first went and made sure ASP.NET 2.0 was enabled in the web services extensions portion of the IIS snap-in, it was. I then used google, NOT LIVE SEARCH, to try and find an answer. After a ton of digging, I found that most of the time the reason this happens is related to a common Windows problem. Somehow, a piece of the registry gets hosed. I tried the fix mentioned in that forum post and it didn’t work. Finally, I found the reason for my particular issue. This one blows my mind. I installed vmware server because M$ Virtual PC is a piece of crap (it wouldn’t let me install Ubuntu). Somehow, vmware server removed my ASP.NET tab. To fix this I had to do the following (found here):

1) Stop the IIS Admin service (and any services that depend on it)
2) Open C:\WINDOWS\system32\inetsrv\MetaBase.xml in notepad or your favorite XML Editor. _DELETE_ the line that reads ‘Enable32BitAppOnWin64=”TRUE”’
3) Start -> Run -> iisreset

I don’t know who to blame here, M$ or vmware. Since it’s usually M$’s fault, I’ll blame them. I guess if Virtual PC weren’t so crappy I wouldn’t have had this issue at all.