Posts

Showing posts with the label MVC

How to Change Web Configuration- .Net

Image
In this article, let me explain, how to automate the process of changing a Web Configuration in ASP.NET. The web transformation would be helpful because: 1. It is a bit difficult to make the same set of changes for a different environment. 2. If the config file has more entries then it would be difficult to traverse manually. 3. Possibilities of typo error. ASP.NET 4.0 has provided a very nice option to transform the web configuration. When we create an ASP.NET application using Visual Studio, it will create a web config file with the following two transformations. Web.Debug.config: Debug mode Web.Release.config: Release mode. When we run the application (publish) in a debug mode, the web.debug.config file would override the web config settings and the Web.Release.config file settings would be used when the application is running in a release mode. Now I want to do the web.Config transformation for other build environments, like: Staging. Production. To do this, I am using the followin...

MVC 3 Razor And Partial View

Image
MVC 3 Razor And Partial View How do I use partial view in MVC 3? Great!! Sometime, I don’t know why, I stuck for small things. I was trying to load two partial views(MVC 3). But, after spending 6 hours I got to know how to load. This retards my brain. I have searching for good articles on MVC 3 & Partial views. But, I failed to get it. So, Let us go in dept on MVC3 & Partial Views. Partial view and User Controls are somewhat same in purpose of usage. But the way in which they is totally different. I will explain about these in detail. Step 1 Create ASP.Net MVC 3 project using VS 2010. I have named it as ARVPartialView. Add one partiaview and name it as PartialIndex Step2 I have created one module like PartialModel as given bellow. using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace ARVPartialView.Models { public partial class PartialModel { public string Name { get; set; } public int Actual { get; se...

Making Offline MVC 3 Application.

Image
Hi Guys!! I never thought building offline MVC 3 app could be this much simple.  I had a question in my mind for a long time: Why this offline application? How it works? Etc.. As per my knowledge, in Silverlight there is a smart client concept. So that, even we can see and work when there is no network available (flight mode or in remote area). Whenever device/app detects network, then either the user can invoke saving operation into server or the application can automatically triggers event to save data. Silverlight did a great job in this aspect. But, in the case of an ASP.NET/HTML application, how can it be done?. For the same purpose, HTML 5 introduces a MIME type manifest and local storage.  It mainly adds one manifest file to load all required recourses. This walkthrough is to demonstrate how we can create/develop offline/online application using MVC 3. I will first create an ASP.NET MVC 3 empty app using VS 2010 and I will add offline htm page to the project. The HTML p...