This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Contains general scripts that may be used in any page. | |
* If this file starts to get large it can be split into page-specific files. */ | |
/* The following code is the Garber-Irish implementation, a way to run relevant JavaScript on page-load | |
* based on the MVC action that produced the page. It's an unobtrusive approach, which means that the | |
* code to call the relevant JavaScript functions is all here instead of being hardcoded into the HTML. | |
* All this code needs from the page is data-controller and data-action attributes on the body tag. | |
* Since JavaScript is case-sensitive, the controller and action names we use here must be an exact match. | |
* http://viget.com/inspire/extending-paul-irishs-comprehensive-dom-ready-execution */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Config | |
{ | |
public abstract class BaseConfigurationElementCollection<TKey, TElement> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dateTimeReviver (key, value) { | |
var a; | |
if (typeof value === 'string') { | |
a = /\/Date\((\d*)\)\//.exec(value); | |
if (a) { | |
return new Date(+a[1]); | |
} | |
} | |
return value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If using Unobtrusive Validation then that library initialised the Validate plugin | |
// on our behalf, so we missed the chance to set invalidHandler. Even if we were to | |
// set invalidHandler now via the settings object it would have no effect, due to the | |
// way that Validate works internally. Instead, we can do the following: | |
$("#MyForm").bind("invalid-form.validate", function () { | |
// Do something useful e.g. display the Validation Summary in a popup dialog | |
$("div.ValSummary").dialog({ | |
title: "Information", | |
modal: true, | |
resizable: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
using Web.Json; | |
namespace Web.Filters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace Web.Filters | |
{ | |
/// <summary> | |
/// Check whether the application is marked as offline in the config file. | |
/// If so, and the user does not have the override permission, throw an exception. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
using Microsoft.Practices.Unity; | |
using Unity.Mvc4; | |
namespace MvcApplication1 | |
{ | |
public static class Bootstrapper | |
{ | |
public static void Initialise() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://dillieodigital.wordpress.com/2011/10/12/automatic-user-and-time-stamping-in-entity-framework-4/ | |
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.Objects; | |
using System.Web; | |
using MyApp.BLL; | |
namespace MyApp.DAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("form[data-block-page-on-submit]").each(function () { | |
$(this).validate().settings.submitHandler = function () { | |
window.BlockPage(); | |
return true; | |
}; | |
}); |
NewerOlder