RMuth

Stories kicked by RMuth

MVC Routes and Magic Strings == “No Good”(www.isi-net.com)

submitted by RMuthRMuth(80) 2 years, 2 months ago

I live and breath with ASP.NET MVC, but from the very beginning I’ve been very uncomfortable with the magic string nature of routes, controllers, and actions. I long ago stopped using the various “action” extensions because they are way too prone to fat finger screw ups and moved nearly 100% to using route extensions and putting my routes names into constants so as not to have any chance of fat finger issues, but recently, after reviewing the source code for MVC2, specifically the “LabelFor” extension, I realized there was even another way to limit fat finger screw ups via routing extensions and lambdas. read more...

add a comment |category: |Views: 27

tags: another

Supporting multiple submit buttons on an ASP.NET MVC view(blog.maartenballiauw.be)

submitted by maartenbamaartenba(5845) 2 years, 6 months ago

A while ago, I was asked for advice on how to support multiple submit buttons in an ASP.NET MVC application, preferably without using any JavaScript. The idea was that a form could contain more than one submit button issuing a form post to a different controller action. The above situation can be solved in many ways, one a bit cleaner than the other. For example, one could post the form back to one action method and determine which method should be called from that action method. Good solution, however: not standardized within a project and just not that maintainable… A better solution in this case was to create an ActionNameSelectorAttribute. read more...

add a comment |category: |Views: 836

tags: another

Serialization In ASP.NET MVC(isi-net.com)

submitted by RMuthRMuth(80) 2 years, 7 months ago

I’ve been doing a lot more with jQuery in ASP.NET MVC than I ever have before. One of the biggest problems I’ve had is in the sending back of JSON to jQuery ajax calls, it seems that the built in MVC action result is not to friendly with dates and/or forms submitted with uploaded files, so with some help of an article @ http://msmvps.com/blogs/omar/archive/2008/10/03/create-rest-api-using-asp-net-mvc-that-speaks-both-json-and-plain-xml.aspx I’ve come up with my own SerializeResult<T> read more...

add a comment |category: |Views: 10

tags: another

Multiple configuration section for different developers(isi-net.com)

submitted by RMuthRMuth(80) 2 years, 7 months ago

We often have multiple developers working on the same project but want to be running under different configurations. We do this by adding their machine name to custom config section and replacing the static constructor of the custom config section read more...

add a comment |category: |Views: 5

tags: another

Extending Enumerations (fun with Enum<enum> and Attributes)(isi-net.com)

submitted by RMuthRMuth(80) 2 years, 7 months ago

Enums are just great, but not very user friendly once you get past simple one word names. In this article I will show you how to make them far more usable via Attributes. We will be able to give them a user friendly name, parse strings to enum based on the enum’s value, member description, and user friendly description, and created orders lists and dictionaries. read more...

add a comment |category: |Views: 377

tags: another

How to use an ASP.NET SiteMapProvider to produce a XML SiteMap(isi-net.com)

submitted by RMuthRMuth(80) 2 years, 7 months ago

Using ASP.NET's SiteMap functionality to produce Google, Yahoo, Bing SiteMap.xml read more...

1 comment |category: |Views: 27

tags: another

NAnt task for Code Signing(isi-net.com)

submitted by RMuthRMuth(80) 2 years, 8 months ago

At ISI we like to sign our assemblies for many reasons, but chief among them is so that we know and can prove that we compiled the assembly. The vast majority of our clients purchase the source code to the applications we work on for them, thus, from time to time, we’ve had problems where a deployed app doesn’t work but the assemblies we delivered work perfectly, and later find out that some one on the client side made a “minor” code change and deployed their own assemblies …… read more...

add a comment |category: |Views: 10

tags: another

Custom Configuration Section(isi-net.com)

submitted by RMuthRMuth(80) 2 years, 10 months ago

I HATE “ConfigurationSettings.AppSettings” !!!! That being said, .NET gives us a great alternative that no one talks about, custom configuration sections. It gives us a fully nestable and strongly typed config section. read more...

add a comment |category: |Views: 19

tags: another