Steve Michelotti

A .NET Developer's Toolbox

  Home  |   Contact  |   Syndication    |   Login
  199 Posts | 0 Stories | 1106 Comments | 51 Trackbacks

News

View Steve Michelotti's profile on LinkedIn

profile for Steve Michelotti at Stack Overflow, Q&A for professional and enthusiast programmers




Google My Blog

What I'm Reading:

Shelfari: Book reviews on your book blog

Tag Cloud


Archives

Post Categories

Code

Publications

August 2009 Entries

A relatively common scenario you might want in your application is the ability for a user to click a link that pops up a little dialog to submit some information. For example, let’s say you have this form where the user could click the “Contact this person” link: After clicking this link, it pops up the following dialog where the user can type in their message: Finally, once the user submits their message, it shows a little confirmation: This scenario can be implemented with MVC with very few lines ......

Thanks to everyone who attended my presentation last night at FredNUG.  The code samples can be downloaded here.

Thanks to everyone who attended my presentation last night at CapArea on C# 3.0 and C# 4.0. You can download the C# 3.0 code samples, C# 4.0 code samples, and the PowerPoint presentation from here. Several people asked me about some of the tools I was using during the presentation. A list of the tools that I use (and more) can be found here. Feel free to email me with any questions ......

In an effort to continually improve as a developer, one of the things I do is read lots of books. Recently I read Rails for .NET Developers by Jeff Cohen and Brian Eng. Overall, I would definitely recommend this book to any ASP.NET developer that wants to learn more about Rails or wants to better understand the concepts behind MVC. Given that ASP.NET MVC was heavily influenced by Ruby on Rails, I wanted to learn more about Rails so that I could have a better understanding of how MVC evolved the way ......

On Tuesday night (August 25), I will be presenting “C# 3.0 Deep Dish with a slice of C# 4.0” at CapArea .NET User Group (but I have to give Brian Noyes credit for the catchy title). The primary content of the presentation will be a deep dive into the C# 3.0 language features. The latter part of the presentation will be an overview of the features coming in C# 4.0. Hope to see you there. Additionally, the next night (Wednesday, August 26), I’ll be at FredNUG presenting Linq to SQL ......

Historically I have always viewed ASP.NET session state as “pure evil.” In-proc session state is about as unreliable as you can get given that you can have timeouts, ASP.NET might recycle itself, IIS might get bounced, no scalability, and cannot work in a web farm. SQL Session state is very resilient and works in web farm scenarios but the performance is not good and at that point you might as well be better off writing your own strongly-typed data access layer rather than blobbing everything in ......

In two previous posts, I talked about ways to create your own HTML Helper to generate a radio button list. In the first post I leveraged the FluentHtml library to create a table layout. In the second post I switched this to using a div instead of a table. The crux of the issue was that I wanted to make sure the the “id” and “name” attributes were set correctly and MVC out of the box doesn’t seem to do this properly. Recently I discovered a way to successfully do this without “wrapping” the FluentHtml ......

Suppose you have a simple sequential screen flow in your application like this: One typical scenario for this is that each screen has its own associated Controller (for the example we’ll say Controller1, Controller2, etc. but obviously they would have meaningful names in the real world). When the user submits Screen1 then the code Controller 1 will have something like this: 1: return this.RedirectToAction("Index", "Controller2"); In fact, each controller would have to have code like this that essentially ......

A co-worker posed an interesting LINQ problem to me tonight so I figured I’d share. They had a collection of items and wanted an algorithm that would create a “collection of collections” where the first three items would be grouped together, second three items, on so on. For example, given a sequence like this: { “a”, “b”, “c”, “d”, “e”, “f”, “g”, “h” }, it would create a structure that contained 3 groups – the first element would be { “a”, “b”, “c” }, the second would be { “d”, “e”, “f” } and the ......

Yesterday I posted a solution for creating a RadioButtonList HTML helper. But upon closer examination, I’ve come to the conclusion that for a horizontal flow of radio buttons, an HTML table is really not the way to go. Perhaps a remnant from the days of web forms past. Based on a conversation I had with a co-worker, HTML output like this would be much better: 1: <div> 2: <input id="Name_Foo" name="Name" type="radio" value="Foo" /><label for="Name_Foo" id="Name_Foo_Label">Foo&... ......

In my continued exploration of C# 4.0, I wanted to put together a simple example of using the C# 4.0 “dynamic” keyword in conjunction with IronRuby. I’ve been shocked at how difficult it was to find code samples on the internet that actually do this. With much persistence (and some significant pointing in the right direction from Justin Etheredge) I got my simple example working. Given that there aren’t many great examples of calling IronRuby from C# 4.0 out there, I figured I better post the code. ......

The MVC framework does not come with a built-in RadioButtonList comes standard in ASP.NET web forms. The MVC Futures assembly (which can be downloaded here) does come with this HtmlHelper but there are some issues with it including the ones described here by Elijah Manor. He concludes that the method in the futures assembly isn’t very useful and states, “To get around this I ended up writing a foreach creating individual Html.RadioButton and labels.” However, he did not show the code he wrote to ......