Category Archives: Uncategorized
KnockoutJS Starter
So, what is knockout? A javascript library. At its core, a javascript library that can be included in a web site/application too add js functionality and enhance user’s experience. Knockout – A MVVM (model-View-ViewModel) library. A Model is an object … Continue reading
Use Code First with an Existing Database
Benefits: You can create database schema first, and then use [Visual Studio Power Tool] (need separate installation; it’s a plug-in to VS 2012) to “reverse engineer” the database into code first models in your solution. 1. First come here to … Continue reading
O’Reilly Programming ASP.NET MVC 4 (6)
Chapter 16 – Logging Enabling custom error in MVC – in Web.Config, change the [customError] to:[on] – enable custom error – display custom error pages (page that does not tell you much about the error)[off] – display the default error … Continue reading
O’Reilly Programming ASP.NET MVC 4 (5)
Chapter 12 – Caching Types of Caching – server-side caching, client-side caching ** Request-Scope caching – use HttpContext.Items to set or get data for the current RequestHttpContext.Items[“IsFirstTimeUser”]=true;bool IsFirstTimeUser = (bool)HttpContext.Items[“IsFirstTimeUser”];** User-Scoped caching (Session-scoped) HttpContext.Session[“username”]=”Abudi”;string name=HttpContext.Session[“username”]; Session timeout limit: (default is … Continue reading
O’Reilly Programming ASP.NET MVC 4 (4)
Chapter 7 – ASP.NET WEB API ASP.NET WEB API leverages web standards (HTTP, JSON and XML) and conventions to provide a simple way to build web services. Web API Controller can live anywhere. E.g., you can create a folder [Api] … Continue reading
O’Reilly Programming ASP.NET MVC 4 (3)
Chapter 6 – Enhancing Your Site With AJAX Partial rendering – making a request from your page to server, to replace a portion of your web page. For example, you have a HTML file (myfile.html)that contains this line: And you … Continue reading
O’Reilly Programming ASP.NET MVC 4 (2)
Chapter 3 – Working with Data Use // to comment out lines in view Two ways to use HTML helper to create labels and controls based on model properties: HttpGet creates a web form for [Create]HttpGet processed the posted [Create] … Continue reading
O’Reilly Programming ASP.NET MVC 4 (1)
Chapter 1 – Fundamentals Model – core business logic and data.View – transforming a model(s) into a visual representation.Controller – controls the application logic and acts as the coordinator between the view and the model. New to MVC 4 Async … Continue reading
Web API notes on Stephen Walther’s post
http://stephenwalther.com/archive/2012/03/05/introduction-to-the-asp-net-web-api.aspx To expose a list of products from the web server as JSON so you can retrieve it using jQuery, options:1. ASMX web services2. WCF web service3. ASHX generic handler4. WCF Data Services5. MVC Controller actions6. Now, Web API Create … Continue reading
Professional ASP.NET MVC 4 (7)
Chapter 11 – ASP.NET Web API Leverage your existing MVC experience with controllers, actions, filters, model binders, dependency injection and the like. MVC and web API both use controllers, but web API does not use the Model-View-Controller pattern. Controller returns … Continue reading