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
// validate the form on submit | |
this.submit( function( event ) { | |
if ( validator.settings.debug ) { | |
// prevent form submit to be able to see console output | |
event.preventDefault(); | |
} | |
function handle() { | |
var hidden; | |
if ( validator.settings.submitHandler ) { | |
if (validator.submitButton) { |
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
$.extend(options, { | |
type: element.getAttribute("data-ajax-method") || undefined, | |
url: element.getAttribute("data-ajax-url") || undefined, | |
beforeSend: function (xhr) { | |
var result; | |
asyncOnBeforeSend(xhr, method); | |
result = getFunction(element.getAttribute("data-ajax-begin"), ["xhr"]).apply(this, arguments); | |
if (result !== false) { | |
loading.show(duration); | |
} |
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.Web; | |
using System.Web.Mvc; | |
using System.ComponentModel; | |
using System.ComponentModel.DataAnnotations; | |
namespace Validators | |
{ |
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.Reflection; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace SFR.TOR.Web.Filters | |
{ | |
/// <summary> |
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
// Set the submitHandler callback via the settings object, as is necessary if you are using Unobtrusive Validation. | |
// If you are not using Unobtrusive Validation then you can set submitHandler in the options object passed to validate(). | |
$("#iTrentExportForm").validate().settings.submitHandler = function (form) { | |
BlockPage(); // you may want to block the page during the Ajax call | |
var container = $(form).find("[data-valmsg-summary=true]"), | |
list = container.find("ul"); | |
if (list && list.length) { | |
list.empty(); |
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 formatDate (d,f){return f.replace(/{(.+?)(?::(.*?))?}/g,function(v,c,p){for(v=d["get"+c]()+/h/.test(c)+"";v.length<p;v=0+v);return v})} | |
// Formats the date as a string e.g. "24/08/2013 17:04" | |
var formattedDate = formatDate(parsedDate, "{Date:2}/{Month:2}/{FullYear} {Hours:2}:{Minutes:2}"); | |
//Instead of using classical format specifiers like "YYYY", "MM", "HH", "mm" etc. | |
//this function uses the Date instance getters like getFullYear, getMonth, etc. | |
//with support for zero-padding. | |
//For example, instead of: |
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
// Disable caching globally, for all Ajax requests | |
$.ajaxSetup ({ | |
cache: false | |
}); | |
// Make an Ajax request with caching explicitly disabled | |
$.ajax({ | |
type: "GET", | |
cache: false, | |
url: "http://example.com/GetSomeData" |
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
/* | |
ELMAH - Error Logging Modules and Handlers for ASP.NET | |
Copyright (c) 2004-9 Atif Aziz. All rights reserved. | |
Author(s): | |
Atif Aziz, http://www.raboof.com | |
Phil Haacked, http://haacked.com | |
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.Linq; | |
using System.Collections.Generic; | |
using System.Web.Mvc; | |
/* Based on the ModelStateToTempDataAttribute class from MVCContrib */ | |
namespace Web.Filters | |
{ | |
/// <summary> | |
/// When a RedirectResult or RedirectToRouteResult is returned from an action, anything in the ViewData.ModelState dictionary will be copied into TempData. |
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.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
using System.Linq.Expressions; | |
namespace Web.Extensions | |
{ |
OlderNewer