ninja star Preview 1 of ASP.NET MVC 2 Released

by Michael Ceranski, posted on July 31 2009
In my humble opinion, MVC for ASP.NET was a very important addition to the ASP.NET stack. WebForms was a bad model that only led people to develop poorly performing web applications. The was largely attributed to the Post-back paradigm that was utilized by most WebForm controls. In any case, MVC tends to be a better pattern because when you PostBack, you are generally going to be more aware of it (because you will probably have to implement some code in the controller). It is not a transparent operation like it tended to be in WebForms. Anyway, getting back to the matter at hand, ASP.NET MVC 2 Preview 1 has been released. According the ASP.NET MVC Roadmap, the theme for ASP.NET MVC 2 is "Improved Productivity and Enterprise Ready." Here are a list of features that will be available in preview ASP.NET MVC 2 Preview 1 Templated Helpers - allow you to automatically associate edit and display elements with data types. For example, a date picker UI element can be automatically rendered... [More]

ninja star ASP.NET WebForms vs. MVC

by Michael Ceranski, posted on June 30 2009
At my first programming job, I remember sending an application to a customer via FTP. In order to make the process easier, I downloaded a feature-rich FTP client and started uploading files. I remember my boss, Cliff, came into my office and took one look at my monitor and said "You kids and your fancy GUIs". This was Cliff's way of saying that I really did not need to download a fancy program in order to upload a single file. On a similar note, when it comes to ASP.NET I often feel that Webforms masks developers from the real truth about real web development. If Cliff was here, he would probably say something like "You Kids and Your Fancy Webforms!". I remember the classic ASP days when I would develop custom scripts to create a data grid. I spent hours adding features like sorting and paging. There was quite a bit of code involved and I took the painstaking steps to try to reduce the amount of roundtrips to the server and to optimize the HTML that was generated.... [More]

ninja star ASP.NET - Creating a Custom Tag Cloud

by Michael Ceranski, posted on June 26 2009
I recently wrote a web application and I wanted to create my own tag cloud. Since I was writing an MVC application I decided to use the HtmlHelper class. In case you are not familiar with it, here is a small description from MSDN: The HtmlHelper class provides a set of helper methods whose purpose is to help you create HTML controls programmatically. All HtmlHelper methods generate plain HTML and return the result as a string. Extensions to the HtmlHelper class are located in the System.Web.Mvc.Html namespace. These extensions add helper methods for creating forms, rendering HTML controls, rendering partial views, input validation, and more. All helper methods and extensions are called using the Html property of the view, which is an instance of the HtmlHelper class. For example, to generate a check box in your form, you would call the Html.CheckBox method. In order to store the data for my tag cloud I decided to use XML. Yes, I could have used a database for my tag cloud but I wan... [More]

ninja star MVC - Using Custom Routes

by Michael Ceranski, posted on June 23 2009
I have been converting a ASP.Net Webforms application to MVC. The application is used to pull up information pertaining to servers and instances on our corporate network. MVC is a perfect fit for this application because people will often look up information by URL hacking and the pretty URLs used by MVC make it easier for users to find data. When using MVC, the controller is the generally the second part of the URL, followed by the action and the Id. If I followed this pattern, then my URL for viewing the details of an instance would look like this: http://SomeUrl/Instances/Details/InstanceName Controller Instances Action Details ID InstanceName I thought this pattern was a little bit too verbose and I wanted users to be able to use a URL like this instead. http://SomeUrl/Instances/InstanceName In order to use my own custom URL mapping I need to create a custom route. This is accomplished by registerin... [More]

ninja star ASP.NET MVC - Checkboxes and Search Flags

by Michael Ceranski, posted on June 18 2009
This week I decided to take a legacy web application that I wrote in ASP.NET and convert it to MVC. I started the process by reviewing the NerdDinner source code and by glancing through the free MVC e-book. Alternatively, you can just jump in head-first and have Google on hot standby for when you get stuck. For background, my application is a search engine which allows users in my organization to find servers, instances, databases and etcetera. The main page of the application looks a lot like Google. The search interface has a basic and simple mode. The advanced mode allows you to specify which attributes are searched, the matching style ( starts with, contains etc. ) and which kind of results are returned. When the form is submitted I check to see which options are checked and I pass them into a stored procedure using LINQ to SQL. On this form I have three different categories, which are attributes, styles and results types. The attributes and result types can have multiple items... [More]

About the author

MikeMichael Ceranski is a developer specializing in the .NET stack. I have spent time as a DBA, Web Developer and even a network engineer. Up til now most of my career has revolved around the .NET stack but I have recently taken an interest in microcontrollers which has forced me to get acquainted with lower level languages such as C, and C++.

View my resume

Sponsors