Format:
Recent snippets matching tags of validation
//******************************// //Prevent wrong input for mobile //******************************// $("#Mobile").keydown(function (event) { // Allow: backspace, delete, tab and escape if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || // Allow: Ctrl+A (event.keyCode == 65 && event.ctrlKey === true) || // Allow: home, end, left, right
13 Views
no comments
//Remeber to use Html.TextBoxFor Html Helper with Html class attribute // a custom method for validating the Departure and Arrival Dates $.validator.addMethod('dateBeginEnd', function () { return new Date($('#DepartureDt').val()) < new Date($('#ArrivalDt').val()); }, 'Depature date must be before Arrival date.'); // a new class rule to group all three methods $.validator.addClassRules({ requiredBeginEndDate: { required: true, date: true, dateBeginEnd: true }
17 Views
no comments
<%@ Page Title="" Language="C#" MasterPageFile="~/Miso1.Master" AutoEventWireup="true" CodeBehind="Currency.aspx.cs" Inherits="WebApplication1.Currency" %> <asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server"> <script type="text/javascript" language="javascript"> $(document).ready(function () { }); String.prototype.replaceAll = function (str1, str2, ignore) { return this.replace(new RegExp(str1.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g, "\\$&"), (ignore ? "gi" : "g")), (typeof (str2) == "string") ? str2.replace(/\$/g, "$$$$") : str2);
48 Views
no comments
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript" src="JavaScript/jquery-1.4.1.min.js"></script> <script type="text/javascript" language="javascript"> String.prototype.replaceAll = function (str1, str2, ignore) {
35 Views
no comments
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript" src="JavaScript/jquery-1.4.1.min.js"></script> <script type="text/javascript" language="javascript"> String.prototype.replaceAll = function (str1, str2, ignore) {
40 Views
no comments
function IsPageValid() { var validated = Page_ClientValidate('UserComments'); if (validated) { //Its valid return true; } else
69 Views
no comments
public static class UnityContainerExtensions { public static void AssertMappingsAreValid(this IUnityContainer container) { foreach (var registration in container.Registrations) { container.Resolve(registration.RegisteredType, registration.Name); } } }
141 Views
no comments
[TestMethod] public void TestRenamedbContextMenu() { dbContext context = new dbContext(); // Load the first menu Menu menu = context.Menus.FirstOrDefault(); // force a change menu.ModifiedOn = DateTime.Now;
281 Views
no comments
/// <summary> /// Validates the email. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.ServerValidateEventArgs"/> instance containing the event data.</param> /// <param name="page">The calling <see cref="System.Web.UI.Page" /> web page.</param> public void ValidateEmail(object sender, ServerValidateEventArgs e, Page page) { var emailAddress = page.FindControl("emailAddress") as TextBox; var firstName = page.FindControl("firstName") as TextBox;
63 Views
no comments
/// <summary> /// An entry that can be either a single ip or a range /// </summary> public class IpEntry { public string StartRange { get; set; } public string EndRange { get; set; } public bool IsRange
475 Views
2 comments
public static IEnumerable<ValidationResult> Validate(object component) { return from descriptor in TypeDescriptor.GetProperties(component).Cast<PropertyDescriptor>() from validation in descriptor.Attributes.OfType<System.ComponentModel.DataAnnotations.ValidationAttribute>() where !validation.IsValid(descriptor.GetValue(component)) select new ValidationResult( validation.ErrorMessage ?? string.Format(CultureInfo.CurrentUICulture, "{0} validation failed.", validation.GetType().Name), new[] { descriptor.Name }); }
278 Views
no comments
//Check for errors bool controlHassErrors = Validation.GetHasError(ProjectNameTextBox); //Update control ProjectNameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); //Set Language private void Application_Startup(object sender, StartupEventArgs e) { CultureInfo culture = new CultureInfo("nl-NL"); Thread.CurrentThread.CurrentCulture = culture;
325 Views
no comments
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MensajeGeneralError.ascx.cs" Inherits="Syllabus_PL.UserControls.WebUserControl1" %> <table cellspacing="0" cellpadding="0" class="cf ve"> <tbody> <tr> <td class="vj"> </td> <td class="vi" /> <td class="vk" /> </tr>
250 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
