Jun 102013
 

Recently I ran across a need for a collection of name / value objects that I could use in JSON and pass up to my MVC Web API.  The problem I ran into is that the NameValueCollection object that is in the Collections.Specialized namespace does not deserialize correctly.

After much searching into the matter I came to find out that it wasn’t the way I was using it but that it didn’t play nicely with serialization into JSON even though it is a serializable object.  When you serialize it to JSON all you receive back are the values.   This became a problem for the deserialization of the object as well.  It obviously wasn’t going to work, so after a quick trip back to the drawing board I decided to make my own set of classes to mimic a NameValueCollection object. Continue reading »

Oct 152012
 
What Happens when an Asp.NET Viewstate Goes Critical

This is a screen capture of a viewstate that got out of control.  Shrunk down and cut off so it would fit on a page.

While working on an ASP.NET forms application I ran into one big problem that was hurting SEO.  The viewstate for one of the pages in the application was ballooning out of control.  This page in question was very important landing page in the application and thus needed the best SEO optimization we could offer. Continue reading »

Jun 292012
 

While working with jQuery one of the methods that I’ve found that I use a lot is $(document).ready(). The biggest problem that I’ve run into with using this method is that when working within ASP.NET and doing an AJAX postback this event does not fire automatically. For good reason, but it can cause serious problems when I need that event to fire on partial postbacks as well. Continue reading »

Apr 022010
 

With the implementation of MVC there is a lot more room for unhanded global exceptions because in MVC you are encouraged to write more in line code to accompany the back end code. So what happens when an exception is thrown within the front end code? Well you’ll have an exception that will bubble up to the global application class which if you don’t handle it there it will continue to bubble and be displayed to the user as specified in the web configuration file. This doesn’t do you much good, sure the user will know that there is an error, and you can squelch the amount of information that is displayed to your ordinary users, but if working through trouble shooting the issue this basic information does you no good. Continue reading »

Jan 192010
 

Recently we had a client ask us to add a label in front of the paging control on an ASP.NET gridview numeric paging control so that users would know what the numbers meant. This seemed like a reasonable request as we were dealing with users who may not be the most tech savvy, plus it didn’t seem like there would be much work that would need to be put in to accomplish this goal. To understand the solution you need to understand the steps at which it took to get there.

The first thing I tried was modifying the PagerTemplate, but little did I know that in ASP.NET when you modify this template on a GridView you overwrite the entire paging control. This obviously wasn’t what I wanted, I just needed to add a little text in front of all the page numbers, I didn’t want to rewrite it entirely. Continue reading »