Skip to main content

Posts

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid. <staticContent> <mimeMap fileExtension=".woff" mimeType="application/font-woff"/> </staticContent> This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error. Solution: 1. Open IIS and click on hosted website 2. On the Featured View tab, double click on MIME type icon and check if .woff extension is present. If on click it gives error not to worry. 3. Open web.config file of project solution and check if .woff mimemap entry is present. If yes, remove that entry. 4. Go back to IIS and follow Step 1 and Step 2. It should show .woff extension now. 5. Check your website and it should work now. Author: Sumit Bajaj Thanks for Reading. Have a great time.

Uploading an Excel and Importing the data in database

This is very common requirement to read the data from uploaded excel and import it in database. Earlier it was a tedious task but not now, thanks to Nuget packages where you get so many utilities to make your life easy. In this post, we will also use Nuget package and perform the task of uploading excel and importing the data in database. There are two steps to perform this, 1. To upload the excel file on server 2. Read the uploaded file and import the data to database Step1: To upload the excel file on server    < asp:FileUpload ID =" excel_upload " runat =" server "/>          if (excel_upload.HasFile)     {         bool upload_file = true ;         string file_upload = Path.GetExtension(excel_upload.FileName.ToString());         if (file_upload.Trim().ToLower() == " .xls " |              file_upload.Trim().ToLower() ...

Unable to launch the IIS Express Web server

I had exactly the same issue. Tried everything but finally one trick worked. Delete folder IISExpress from "My Documents" Load your project again, it will create IISExpress folder again with updated configuration Check IISExpress folder has sufficient permissions to read-write the configuration file Load project again and Run IISExpress. It should work. Author: Sumit Bajaj

Create dynamic content using Razor templates

This article is explaining the usage of Razor template and effectiveness of these templates. Let's consider one scenario, when you have to send emails to different users with dynamic data which is different for different users. Example shown below is a basic example. Think of some complex scenario where plenty of data need to be changed and also require some styling. To start work on one simple example, right click on your website folder and create a new blank @view. Name it as "Useremail.cshtml". Paste the mentioned code there. Useremail.cshtml     < html >    < body   style =" font-family :  Arial ;  font-size :  smaller">     < p > Dear  @ Model.Name, </ p >      < p > A new account has been created for you to access Application with                            username:  < ...

Nuget Error: "No more data is available"

Unable to install Nuget Package Manager on Visual Studio 2010 SP1, Windows 7, 64 bit machine. When creating new MVC4 Project, getting Nuget Error "No more data is available". Here are the steps which will resolve the issue. 1. Open Visual Studio -> Tools -> Extension Manager... 2. From Online Gallery, Download Nuget Package Manager If you get error like "No more data is available", Download it from Nuget Website . 3. Once downloaded, change the extension "vsix" to "zip"     For example:  Nuget.Tools.vsix  -> Nuget.Tools.zip 4. Goto path   C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\ide\Extensions\Microsoft Corporation\NuGet Package Manager\1.6.21205.9031 if it is not existing, create the folders so path could look like above path. 5. Unzip the Package (see step 3) in the folder (see step 4) 6. Now ...\NuGet Package Manager\1.6.21205.9031 should have all dlls and respective files 7. Restart ...

Steps to migrate from other CMS to Sitecore

Here are few easy steps to migrate the data from other CMS to Sitecore 1. Get the detail of CMS from where to migrate in Sitecore 2. Export the articles or items in xml format. Generally all CMS gives this option to export it in xml file format 3. Read the xml tags one by one to get all related details ( code given is just for reference ) //Get all files under specific directory string [] files = Directory .GetFiles(path); List < ArticleData > articleList = new List < ArticleData >(); //Read each file one by one foreach ( string filePath in files) {      XmlDocument xmlDoc = new XmlDocument ();     xmlDoc.Load(filePath);                  ArticleData article = new ArticleData ();     article.FileName = filePath.Substring(path.Length + 1, (filePath.Length - (path.Length + 1)));     XmlNodeList list = xml...

Sitecore 7: The Power Packed

Sitecore 7 is new release of Sitecore content management system. It came up with so many exciting features that when someone will go through, definitely will say Wow!!. The industry's first fully integrated search based architecture. Out of so many power-packed features, here is the list of few. Search Boosting: It allows content to be pushed higher in the search. Rules are provided which can be easily created in sitecore depending on business requrements. For example: If we have 100 featured results to be displayed on page, then by boosting your items can up-rank it on top. Dynamic Data: The nice change in Data source field. It allows to write query based data source which make it fully dynamic.  Criteria can be written in Build Query dialog box. Search Tagging: Inbuilt tagging mechanism pulls the content in search which is tagged. It is used for fetching more accurate data. No coding, its just add tags on item and you are done. Big Data: There i...