Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - ASP.NET_Core_Model_Binding_Samples</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
string _PropertyNameAttributeIsAppliedTo;
string _filePath;
public CustomDate([CallerMemberName]string propertyName = null, [CallerFilePath] string filePath = null) // gets the property name
{
_PropertyNameAttributeIsAppliedTo = propertyName;
_filePath = filePath; // //Returns full path of the calling class
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.Extensions.Localization;
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.AspNetCore.Mvc.Rendering;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.Mvc.Razor;
@model JobApplication
@using System.Globalization
@inject IStringLocalizer<SharedResource> loc
@{
Layout = "_Layout";
ViewData["Title"] = "Job Application";
}
<h2>Job Application</h2>
// ******************************************* Main.js ********************************************************
// Make sure sw are supported
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('../sw_cached_pages.js') // register the serviceWorker
.then(reg => console.log('Service Worker: Registered (Pages)'))
.catch(err => console.log(`Service Worker: Error: ${err}`));
});
}
// *************************** Main.js **********************************
var worker = new Worker('/Scripts/fileupload.js'); // fileupload.js is our webworker script file
worker.onmessage = (e) => { // called when ww calls self.postMessage
console.log(e.data);
};
worker.onerror = (e) => { // onerror
console.log('ERROR: Line ', e.lineno, ' in ', e.filename, ': ', e.message);
}
// **************************************** HTML *****************************************************
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>