IMPROVED ASP.NET MVC SECTIONS

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
1.25.2014 ~ 01:50 PM
posted in professional
tagged in asp-net : mvc : orchard : orchard-cms : c#
comments [1]

 

ORCHARD CMS - ERRORS WHEN PUSHING CHANGES IN THE MIGRATIONS FILE

I really love the Orchard CMS (the CMS engine built upon the .NET MVC Framework), but it isn't without its quirks. I've found that often times, when I try to delete a column from an existing table in the migrations file, the site inexplicably starts throwing errors. After digging through the error log, I found that the error usually is along the following lines:

Error when updating module: "A tenant could not be started: Default NHibernate.PropertyNotFoundException: Could not find a getter for property '{property}' in class '{className}'" 

Basically, even though the column was deleted in the migrations file, Orchard is still looking for that column.

[continue reading]

Orchard CMS - Errors When Pushing Changes in the Migrations File
2.07.2013 ~ 04:57 PM
posted in professional
tagged in c# : asp-net : orchard : orchard-cms
comments [0]