Posts

Showing posts from May, 2014

SharePoint uses Post method to display provider-hosted app in iframe

Classic book example for the simple MVC application doesn't work if you want to display it as provider hosted app in SharePoint! By classic, I mean situation where you have 2 Controller's actions with the same name, but for different HttpMethods: Get and Post. You use "Get" to display information to a user and "Post" to retrieve updated information back from the user. For example, EditProduct "Get" action will return some product information, and EditProduct "Post" action will receive updated model from the view and presumably save it to the DB. It gets tricky with SharePoint - it always sends HttpPost to your Controller, so EditProduct "Post" action gets hit. The only workaround I found so far (I don't have that extensive experience with MVC as I have with WebForms) is to simply rename EditProduct "Post" action to SaveProduct and explicitly set Form action to "SaveProduct".

Restore Sitecore master DB doesn't restore items state

If you just need an answer - go to the last paragraph! :) Otherwise, you can read the full story how I found the solution. Today, I come across an interesting issue with Sitecore master database. I made some changes to the content tree and later on I decided to revert them and reset master database state to initial state. So, I asked my team to restore master db to the previous backup (that was taken a day ago). After a restore had been finished, we verified Content Editor and were so surprised to see items that we added just today. These changes shouldn't be there. So, I requested one more restore (just in case), I verified db backup file date - everything was alright, however changes still appeared in the Content Tree. So, I opened Items table in the Sitecore master database and then I understood what is wrong - these changes were not there, which means Sitecore takes them from somewhere else. Sitecore tends to cache a lot of information, so when you restore its' Master