This website is no longer actively supported
Written by John DeVight on 11 May 2011 17:40
Written by John DeVight on 2011-May-11
I am working on a prototype for a new project and will be using ASP.NET MVC to develop the application. I've seen ExtJS used, and it looks great! However, the challenge is to integrate ASP.NET MVC with ExtJS. This is the first of a series of wiki pages about integrating ASP.NET MVC and ExtJS.
Create an ASP.NET MVC3 Web Project.
- Launch Visual Studio and create a new Project. Select Visual C# -> Web -> ASP.NET MVC 3 Web Application.
- In the "New ASP.NET MVC 3 Project" dialog, Select the "Empty" template and the "Razor" View engine.
- In the "Controllers" folder, add a new controller called "HomeController".
- In the "Views" folder, create a "Home" folder.
- In the "Views" -> "Home" folder, add a new view. Give the view a name of "Index". Be sure that the view engine selected is "Razor" and that the master page is selected.
Add the required ExtJS files into your Web Project.
- In your web project, add a new folder called "extjs".
- Locate the extjs download, extract the contents of the zip file and open the root folder. At the time of this blog, I am using version 3.3.1, so the root folder is called ext-3.3.1.
- From the root folder, copy the "adapter" folder, "resources" folder and ext-all.js into the "extjs" folder created in step 3.
- Include the the entire contents of the "extjs" folder into your project.
Referencing the required ExtJS css and js files.
- Open the "View" -> "Shared" -> (_Layout.cshtml or Site.Master) file.
- Add the following within the "head" tags:
That's everything that you need to do to configure your ASP.NET MVC3 Web Project to use ExtJS!
Support ASP.NET Wiki
If you like this page, click on the "Share on" links in the wikidot toolbar at the top of the page to share it with your friends.