ASP.Net MVC: Button Post Is Losing QueryString Values And Getting Paramters From A URL
I was going to start this post with a rousing ARE YOU READY FOR SOME PROGRAMMING?, but my lawyer suggested it might cause the NFL to take action against me. He suggested something more simple like PROGRAMMING HAPPENS HERE! since he had high doubts the NBA will sue me. After all they’d have to admit [...]
ASP.Net MVC: Create a link method… ie JUST GIVE ME THE STUPID URL
One thing that kind of annoys me is the situation where you just want a url, but you don’t want one of the prepackaged links using: Html.RouteLink Or Html.ActionLink Mostly because you want to be able to create your own html and you only want the created url. Well turns out there’s a method for [...]
Paging and the Entity Framework, Skip, and Take Part 4
Get the total count of pages. | Get the real page number. | Using Skip and Take to Page | The Actual Paging Controls Now onto the fourth part of this epic saga that George Washington once called, “The most astounding exercise in futility” Ok so let’s say you have a grid, items to fill [...]
Paging and the Entity Framework, Skip, and Take Part 3
Get the total count of pages. | Get the real page number. | Using Skip and Take to Page | The Actual Paging Controls Ok so the last two posts have been arguably useless, maybe more so than anything else here, but they were somewhat needed because now I am going to show how to [...]
Paging and the Entity Framework, Skip, and Take Part 2
Get the total count of pages. | Get the real page number. | Using Skip and Take to Page | The Actual Paging Controls So in part one I posted the method to find the total count of pages you’ll need so that you don’t go too far while paging. Now it’s about trying to [...]
Paging and the Entity Framework, Skip, and Take Part 1
Get the total count of pages. | Get the real page number. | Using Skip and Take to Page | The Actual Paging Controls So something I’ve been doing a lot of lately is making quite possibly the best thing ever: String cheese wrapped in turkey bacon. But when I’m not doing that, I am [...]
Duck Typing my way to a Universal String Convert
So being the beacon of ignorance in the fog of brilliance, I had no idea what Duck Typing was. In short it’s the idea of assuming a class’s type based on the methods it holds. Say you have 5 different classes, none of which share an inheritance tree. Now let’s say you have a method [...]
Convert Enum to Dictionary: Another Silly Method
So what if you want the names and values from an Enum, but wanted them in dictionary form. Well shoot, a little bit of linq and little bit of that and you got this: public static IDictionary<String, Int32> ConvertEnumToDictionary<K>() { if (typeof(K).BaseType != typeof(Enum)) { throw new InvalidCastException(); } return Enum.GetValues(typeof(K)).Cast<Int32>().ToDictionary(currentItem => Enum.GetName(typeof(K), currentItem)); } [...]
Yeah SessionTryParse
So I got tired of seeing If Session["SomeKey"] != null… blah blah blah and thought it would be a semi worthwhile task to create a TryParse method because I’m bad like that. Not a Bad Enough Dude to Save the President, but bad. public static Boolean SessionTryParse<K>(HttpSessionState session, String key, out K itemToSet) where K [...]
Convert a String to a Number String With Linq… YAY
Really stupid little thing I came up with today… but I wanted to use Linq to strip any non number from a string and return the string with only numbers. I told you this was a stupid little thing. public static String CreateNumberOnlyString(String textToCheck) { String returnText; var queryForIntegers = from currentChar in textToCheck where [...]



