Saturday, July 31, 2010

ASP.NET Vs ASP.NET MVC

Web Forms is a matured technology for web development using ASP .Net. It is a great way to develop enterprise web applications. Web Forms are similar to Windows Forms in that they provide properties, methods, and events for the controls placed on them. With the rich set of native server controls and myriad of third-party controls, Web Forms technology accelerates application development


introducing View State and Postbacks. It also mimics the event-driven model of Win Forms. For complex web pages with a lot of data, the size of View State may become a performance issue, but proper design of web pages eliminates this issue. For developers coming from desktop applications development background, Web Forms is easy and intuitive to understand and practice


ASP .NET MVC
MVC design pattern is out there for a long time with many successful implementations available. It is very popular and extremely useful in achieving separation of concerns (SOC) in the UI layer. ASP .NET MVC is Microsoft implementation of MVC design pattern for web development.
Due to clear separation of concerns in UI layer, unit testing becomes very easy. In today’s development environment where test driven development (TDD) is being embraced with great enthusiasm, ASP .NET MVC is very useful.

Source :- http://it.toolbox.com/blogs/third-angle/asp-net-web-forms-vs-asp-net-mvc-35645

More details


ASP.Net Web forms Vs MVC Pattern Discussions
********************************************
http://weblogs.asp.net/despos/archive/2009/04/11/web-forms-vs-asp-net-mvc.aspx

http://blogs.gaiaware.net/post/MVC-on-ASPNET-without-ASPNET-MVC.aspx
http://www.ytechie.com/2008/10/aspnet-mvc-pros-and-cons.html
http://www.asp.net/general/videos/choosing-the-right-programming-model

WebForms Vs NVelocity vs NHaml vs Spark. View Engine

Need to analyze..

ASP.NET MVC ViewEngine.. WebForms Vs NVelocity vs NHaml vs Spark which is efficient?

.aspx gets the job done, everyone is familiar with it, zero learning curve, constant developement (etc etc), new things appearing on regular basis and I think it is quite feature rich


Imagine a situation where you will receive a lot of design stuff from your co-worker and you will start rewriting it to NHaml...wow, how geeky! I know it can be automated but...why?

But just because I have a hammer in my hand not everything for me is a nail. I CAN change view engine, but give me _concise_ reason to do so.


xample View: Web Forms
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
CodeBehind="List.aspx" Inherits="MvcApplication5.Views.Products.List" Title="Products" %>

<%= ViewData.CategoryName %>



    <% foreach (var product in ViewData.Products) { %>

  • <%= product.ProductName %>


  • <% } %>

<%= Html.ActionLink("Add New Product", new { Action="New" }) %>


Example View: NHaml
%h2= ViewData.CategoryName%ul
- foreach (var product in ViewData.Products) %li = product.ProductName .editlink = Html.ActionLink("Edit", new { Action="Edit", ID=product.ProductID }) = Html.ActionLink("Add New Product", new { Action="New" })



Source :- http://haacked.com/archive/2008/12/08/asp.net-mvc-northwind-demo-using-the-spark-view-engine.aspx
http://www.slideshare.net/jesschadwick/introduction-to-aspnet-mvc-3353914

ASP.NET MVC Controller

The ASP.NET MVC framework maps URLs to classes that are referred to as controllers. Controllers process incoming requests, handle user input and interactions, and execute appropriate application logic. A controller class typically calls a separate view component to generate the HTML markup for the request.

Thursday, July 29, 2010

Solving-the-IT-Turnover-Crisis

http://thedailywtf.com/Articles/Up-or-Out-Solving-the-IT-Turnover-Crisis.aspx

Wednesday, July 28, 2010

ASP.NET MVC Tips

Adding Links between pages

Our Store Index page lists Genres as plain text. We can easily convert those to dynamic links to our Browse page, so clicking on Disco will navigate to /Store/Browse?genre=Disco. We could just hardcode those links, as follows:
?


That works, but it could lead to trouble later since it relies on a hardcoded string. For instance, if we wanted to rename the Controller, we'd need to search through our code looking for links that need to be updated.

Instead, we can make use of an HTML Helper method. ASP.NET MVC includes HTML Helper methods which are available from our View template code to perform a variety of utility tasks just like this. You'll use the Html.ActionLink helper method pretty often, since it makes it easy to build links and takes care of annoying details like making your paths are properly URL encoded.

Html.ActionLink has several different overloads to allow specifying as much information as you need for your links. In the simplest case, you'll supply just the link text and the Action method. For example, we can link to "/Store/" on the Store Details page with the link text "Go to the Store Index" using the following call:
?
<%: Html.ActionLink("Go to the Store Index", "Index")%>

Note: In this case, we didn't need to specify the controller name because we're just linking to another action within the same controller that's rendering the current view.


Source :- -http://www.asp.net/mvc/tutorials/mvc-music-store-part-2

Tuesday, July 27, 2010

What is View Model vs Model in ASP.NET MVC

ViewModels, which are created just to pass information from our Controller to our View

Model classes are built to contain and manage our data and domain logic

Code Nuggets in ASP.NET/MVC

Important Note

Note: Prior to ASP.NET 4, the <%= %> syntax was used to execute code and write it out to the page. Starting with ASP.NET 4, you should always use the <%: %> syntax instead, since it will automatically HTML Encode the results, similar to how we used Server.HtmlEncode() in our controller action earlier.

Friday, July 16, 2010

ASP.NET MVC

http://weblogs.asp.net/plip/archive/2007/12/09/is-mvc-right-for-you.aspx

Great quotes in the link.

"In reality, you as a developer can still put code in the wrong place, you can still make bad decisions on how to structure your application and you can still essentially cock the whole thing up."

"Some of the ASP.NET code I've seen in my time has literally made me cry it's been so badly constructed. " -- True......... 100% . A good passionate s/w developer can never tolerate this...


" I'm neither a Conservative or a Socialist, I'm a Liberal." ----


"If you're used to ASP.NET Web Forms and move to the MVC approach, so much of the knowledge you've gained (lovingly) over the years of ASP.NET development is effectively lost."

Saturday, July 10, 2010

My Code project article in interesting finds

My Code project article

http://www.codeproject.com/KB/aspnet/GridViewExpandCollapseRow.aspx

available in one of the interesting Finds

http://www.jasonhaley.com/blog/post/2010/07/08/Interesting-Finds-July-9-2010.aspx

My Code project article in interesting finds

http://www.jasonhaley.com/blog/post/2010/07/08/Interesting-Finds-July-9-2010.aspx

Tips for writing high performance web app in asp.net

10 tips for writing high performance web applications
http://msdn.microsoft.com/en-us/magazine/cc163854.aspx