Skip to content

Instantly share code, notes, and snippets.

View nootn's full-sized avatar

Andrew Newton nootn

View GitHub Profile
@nootn
nootn / NewLayout1.cshtml
Created August 15, 2012 08:32
MVC Mega Forms quick start guide - Form Layout
@using (Html.BeginControlGroup())
{
@Html.ControlLabelFor(m => m.Input01)
using (Html.BeginControls())
{
@Html.EditorFor(m => m.Input01)
using (Html.BeginHelpInline())
{
@Html.ValidationMessageFor(m => m.Input01)
}
@nootn
nootn / ConfigureIocAndAop.cs
Created July 9, 2012 13:10
MiniProfiler.Windows IOC and AOP
private static void ConfigureIocAndAop()
{
var builder = new ContainerBuilder();
//If using an IOC container, it is a handy to be able to us an IProfiler to
//wrap mini profiler calls just to remove that dependency for unit testing
builder.RegisterType<MiniProfilerWrapper>().AsImplementedInterfaces();
//We want some classes that do some work, but we don't want to have to wrap profiler steps
//around each method call, so use AOP to do it for us!
@nootn
nootn / DoSomeProfiling.cs
Created July 9, 2012 12:15
MiniProfiler.Windows Samples
using (StackExchange.Profiling.MiniProfiler.Current.Step("Call Methods"))
{
//Some work to be done here
}
@nootn
nootn / CustomJavascriptConfiguration.js
Created April 23, 2012 21:28
MVC Mega Forms quick start guide - CascadingSelectList
var MegaFormsCascadeJQueryHideEffect = 'fast'; //sets the jQuery effect to use when hiding a child cascaded list just before refreshing its items
var MegaFormsCascadeJQueryShowEffect = 'fast'; //set the jQuery effect to use when showing a child cascaded list just after refreshing its items
@nootn
nootn / CustomJavascriptConfiguration.js
Created April 23, 2012 10:10
MVC Mega Forms quick start guide - ChangeVisually
//Supply defaults for MegaForms
var MegaFormsChangeVisuallyJQueryParentContainerSelector = '.container'; //sets the class of a component that wraps a whole form control (I.e. label + input + validation message)
var MegaFormsChangeVisuallyJQueryHideEffect = 'fast'; //sets the jQuery effect to use when hiding a field
var MegaFormsChangeVisuallyJQueryShowEffect = 'slow'; //set the jQuery effect to use when showing a field