A .NET library for all things random!

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam id commodo ante. In sagittis massa metus, ac viverra enim rhoncus vitae. Nunc ac orci orci. Nam sit amet metus nunc. Donec bibendum arcu a volutpat malesuada. Phasellus dapibus sapien non nisl posuere, at molestie ante iaculis. Mauris ligula neque, volutpat quis auctor at, eleifend eget lorem. Interdum et malesuada fames ac ante ipsum primis in faucibus. In quis orci id est ullamcorper gravida et porttitor tellus. Proin libero lacus, rhoncus vel nulla at, dignissim pulvinar ante. In hac habitasse platea dictumst. Donec ultricies turpis vitae massa aliquet porttitor. Donec eleifend sagittis dui. Donec venenatis vel dolor id dapibus. Etiam id arcu nibh.

Whoops. Sorry about that...

[continue reading]

Introducing Lorem.NET
08.20.2014 ~ 03:53 AM
posted in professional
tagged in c# : asp-net
comments [1]



I'm taking a break from my umbrella series in an effort to contribute to society, instead of distracting it!

I really wanted to like ASP.NET MVC Sections... but I just couldn't. They just seem so rigid.

For instance, say I had a section right before the end of my body tag to stash all JavaScript files -- this is great, except I can only add code to this section one time, from one View. But what if my View renders other [partial] Views, all of which need to add JavaScript to the end of the body? Because of this drawback, sections became almost entirely useless to me.

Orchard [a popular CMS engine I've talked about before] has the Script.Head() and Script.Foot() methods, and these seemed like a big improvement. You could add code to these anywhere, and as many times as you liked. Unfortunately, while it is a step in the right direction, it still isn't quite dynamic enough. It only allows two sections: the head and the foot (and not to mention the application has to be built within Orchard). So yet again, even though these Orchard helpers are good, they aren't good enough.

[continue reading]

Improved ASP.NET MVC Sections
01.25.2014 ~ 01:50 PM
posted in professional
tagged in asp-net : mvc : orchard : orchard-cms : c#
comments [0]



In the past, if you needed to run startup code in a class library, you included a method call in the "Application_Start" of the Global.asax file. Thankfully, .NET 4.0 has made things easier with the PreApplicationStartMethodAttribute! This helpful attribute allows us to hand-pick code to execute when the application starts without ever modifying the Global.asax file, or messier yet, creating an HttpHandler.

Let's see it in action!

[continue reading]

Simulate "Application_Start" in Class Library
12.30.2013 ~ 12:37 AM
posted in professional
tagged in asp-net : c#
comments [2]



Creating background tasks in .NET has always been a bit of a pain. You want to create something localized to your project solution that doesn't have to deal with scheduled tasks or other kinds of tomfoolery. Well, thankfully, those days are far behind us! All we need is a little... magic!

[continue reading]

Introducing "ScheduleMagic" A Simple Task Scheduler for ASP.NET
12.03.2013 ~ 02:21 PM
posted in professional
tagged in scheduled-tasks : c# : asp-net
comments [0]



If you've worked within a SharePoint project, you may have noticed the absense of the "Global.asax" file. The SharePoint infrastructure doesn't include this file, so all methods within it, including the "Application_Start", are also unavailable. However, with some tricky maneuvering, we are able to simulate it.

[continue reading]

Simulate "Application_Start" in Sharepoint
11.25.2013 ~ 03:30 PM
posted in professional
tagged in sharepoint : c# : asp-net
comments [0]