This page is used for taking my notes during my daily programming works. It helps myself, of course, on quick references before searching. And I am glad if you find it useful.
ASP.NET MVC
-
Ignore a path for downloads (or accessing static files in ASP.NET MVC Web Application)
Add a line below to the
RegisterRoutes()
method in theRouteConfig.cs
file.routes.IgnoreRoute("Downloads/*");
or to ignore all
routes.IgnoreRoute("");
Full class
public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); // allow to access static files under /Downloads/*.* = no routing this path to Controller in MVC routes.IgnoreRoute("Downloads/*"); //routes.IgnoreRoute(""); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } }
Front-End Libraries (CSS, HTML, JavaScript, jQuery plugins…)
-
SweetAlert: makes popup messages pretty.
-
Owl Carousel 2: creates a beautiful responsive slider, touch enabled
-
VenoBox: responsive jQuery Lightbox plugin, suitable for images, inline contents, iFrames, Google-Maps, Ajax requests, Vimeo and YouTube videos
Link: https://veno.es/venobox/
-
Isotope: position items with different layout modes, sorting, filters…
-
AOS: Animate On Scroll Library
-
GLightbox: A touchable Pure Javascript lightbox with mobile and video support.
-
Magnific Popup: a responsive lightbox & dialog script
Link: https://dimsemenov.com/plugins/magnific-popup/
Example of using Magnific Popup for playing YouTube is here
-
BootstrapMade: Free Bootstrap Templates
-
AdminLTE Bootstrap Admin Dashboard Template: Best open source admin dashboard & control panel theme. Built on top of Bootstrap, AdminLTE provides a range of responsive, reusable, and commonly used components.
Have a free template for download Link: https://adminlte.io/
-
Argon Dashboard: Free Dashboard UI for Bootstrap - MIT License
-
Shards: A free and modern UI toolkit for web makers based on the popular Bootstrap 4 (final) framework.
-
CSS-trick: overflow-wrap
Link: https://css-tricks.com/almanac/properties/o/overflow-wrap/
My code example copied from above link is here
Remember to use
overflow-wrap
ortext-break
(preferred) from Bootstrap to prevent long strings of text from breaking your components’ layout -
cookie-consent-js: A simple dialog and framework to handle the German and EU law (as written by EuGH, 1.10.2019 – C-673/17) about cookies in a website.
Newtonsoft Json.NET
-
JToken
Link: https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_Linq_JToken.htm
The JToken hierarchy looks like this:
JToken - abstract base class JContainer - abstract base class of JTokens that can contain other JTokens JArray - represents a JSON array (contains an ordered list of JTokens) JObject - represents a JSON object (contains a collection of JProperties) JProperty - represents a JSON property (a name/JToken pair inside a JObject) JValue - represents a primitive JSON value (string, number, boolean, null)
EF & EF Core
-
Differences in connection string
2 flashes
\\
in connection stringServer=(LocalDB)\\MSSQLLocalDB
inappsettings.json
file{ "ConnectionStrings": { "DefaultConnection": "Server=(LocalDB)\\MSSQLLocalDB;Database=AppDb;Trusted_Connection=True;" } }
but ONLY 1 flash
\
in connection stringServer=(LocalDB)\MSSQLLocalDB
indotnet ef dbcontext scaffold
commanddotnet ef dbcontext scaffold "Server=(LocalDB)\MSSQLLocalDB;Database=AppDb;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -o Models