@manhng

Welcome to my blog!

ASP.NET MVC

August 20, 2020 23:38

ASP.NET MVC

https://dzone.com/articles/top-10-websites-written-using-aspnet-mvc

https://www.danylkoweb.com/Blog/10-reasons-to-start-using-aspnet-mvc-E9

https://www.danylkoweb.com/Blog/where-can-i-find-sample-aspnet-mvc-projects-HL

https://builtwith.com/toolbar

ASP.NET Core 3.1 Web API + .NET Core CLI

https://medium.com/swlh/securing-your-net-core-3-api-using-identity-93d6426d6311 (HAY HAY HAY)

https://www.learnentityframeworkcore.com/walkthroughs/existing-database (HAY HAY HAY)

https://stackoverflow.com/questions/56862089/cannot-find-command-dotnet-ef

https://docs.microsoft.com/en-us/dotnet/core/tools/troubleshoot-usage-issues

https://github.com/dotnet/efcore/issues/15448

dotnet tool install --global dotnet-ef

AdminLTE + ASP.NET MVC + Angular

June 1, 2020 10:10

AdminLTE + ASP.NET MVC (edit)

https://github.com/go2ismail/AdminLTE-ASP-NET-MVC/

https://marketplace.visualstudio.com/items?itemName=c0shea.AdminLTETemplate

https://www.prishusoft.com/blog/Integrate-AdminLTE-theme-to-Angular-Project.html

Integrating AdminLTE with ASP.NET Core 3.1 – Detailed

https://www.codewithmukesh.com/blog/integrating-adminlte-with-aspnet-core/ (ASP.NET Core 3.1)

https://www.howtosolutions.net/2020/06/visual-studio-asp-net-mvc-project-installing-adminlte-dashboard-template/

ASP.NET MVC 5 Training

https://www.c-sharpcorner.com/article/layouts-master-pages-in-Asp-Net-mvc-5-0-part-fourteen/

Top 20 GitHub-hosted projects of 2019

https://dev.to/areknawo/top-20-github-hosted-projects-of-2019-2f4f

Blog engine based on ASP.NET Core 3.1 and Twitter Bootstrap 4

https://github.com/danielpalme/MVCBlog

My Blog as an ASP.NET Core 3.1 Project http://wildermuth.com

https://www.palmmedia.de/Blog/2013/9/6/aspnet-mvc-4-blog-engine-based-on-twitter-bootstrap

https://github.com/shawnwildermuth/WilderBlog

I re-wrote my blog using a new stack of web technologies including:

  • ASP.NET Core 3.1
  • Entity Framework Core 3.1
  • Vue 2.x
  • Bootstrap 4
  • Azure Websites (Docker) and Azure Blob Storage

The ASP.NET Interns ship their project - A basic blog template for .NET Core

https://www.hanselman.com/blog/TheASPNETInternsShipTheirProjectABasicBlogTemplateForNETCore.aspx

A blogging engine based on HTML5 and ASP.NET

https://github.com/madskristensen/MiniBlog

ASP.NET MVC with Entity Framework and CSS

https://github.com/Apress/asp.net-mvc-w-entity-framework-css

ASP.NET Core Samples

https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/data/ef-mvc/intro/samples/cu-final

ASP.NET MVC Core 2 project using CoreUI.io template

https://github.com/mvelosop/AspNetCore2CoreUI

AdminLTE + Select 2 + ASP.NET MVC 5

https://www.intertech.com/Blog/selecting-multiple-items-using-select2-in-mvc-5/

AdminLTE

https://codecanyon.net/tags/mvc

https://stackoverflow.com/questions/tagged/adminlte

https://adminlte-mvc5.azurewebsites.net/

ASP.NET Core 2.2 Roles And Memberships Customization Implemented Using Beautiful AdminLTE Template. C# as programming language and EF (Entity Framework) as ORM.

https://github.com/go2ismail/AdminLTE-Roles-And-Memberships-Example

Features:

  1. configuration over development (Identity configuration through appsettings.json)
  2. custom error handling (ex: 404 and 500 custom error page)
  3. user membership with dynamics roles management
  4. dbinitializer for data seed (ex: super admin user initialization)
  5. user registration and change password management
  6. basic profile management
  7. override identity user with custom column
  8. active / de-active member
  9. custom security service implemented through DI (dependency injection)
  10. xsrf / anti forgery token

Technical:

  1. C#
  2. EF (Entity Framework)
  3. jQuery
  4. Bootstrap
  5. Datatables.net
  6. crud
  7. toastr
  8. mssql

Development Tools & Environment

I'm using Visual Studio Community 2017 for the development tools on Windows 10 machine.

.Net Core Version

I'm using .Net Core 2.2

AdminLTE - ASP.NET Core 2.x

ASP.NET Example version of famous and beautiful AdminLTE control panel themes and template. http://adminlte-template.indotalent.com

https://github.com/go2ismail/adminlte-aspnetcore2-version

AdminLTE

AdminLTE - is a Free Premium Admin control Panel Theme Based On Bootstrap 3.x

the creator of AdminLTE is Abdulllah Almsaeed

follow this AdminLTE link for original HTML/JavaScript version.

ASP.NET Core 2 MVC Version

this repo, provide full ASP.NET Core 2 MVC version of AdminLTE, consisting all the demo pages provided by HTML/JavaScript version of AdminLTE such as:

  • Dashboard
  • Layout
  • Widgets
  • Charts
  • UI Elements
  • Forms
  • Tables
  • Calendar
  • Mailbox
  • Examples
  • Multilevel

Development Tools & Environment

I'm using Visual Studio Community 2017 for the development tools on Windows 10 machine. For this project, i'm using AdminLTE version 2.4.0.

AdminLTE ASP.NET Core 2 MVC Version Usage

You can Clone / Download the repo and then start building beautiful web app using this visual studio solution. From this project you can also learn how to:

  • work with controller
  • work with view
  • work with partial view
  • work with layout
  • work with JavaScript / jQuery
  • work with razor
  • create HTML helper extension

Simple CRUD Example

I have provide simple Ajax jQuery CRUD example

AdminLTE on this blog

https://manhng.com/archive/adminlte/

AdminLTE - FullCalendar

https://www.c-sharpcorner.com/article/asp-net-mvc5-full-calendar-jquery-plugin/

https://gunnarpeipman.com/using-fullcalendar-jquery-component-with-asp-net-mvc/

https://www.toshalinfotech.com/Blogs/ID/115/How-to-Integrate-Full-calendar-with-MVC-application

https://github.com/RobertHajbok/FullCalendarMVC

https://www.codeproject.com/articles/874283/event-calendar-in-asp-net-mvc-and-entity-framework

AdminLTE - ASP.NET MVC 5

AdminLTE - Free admin dashboard template based on Bootstrap 4 https://adminlte.io

https://github.com/ColorlibHQ/AdminLTE

ASP.NET MVC - Installing AdminLTE dashboard to replace Bootstrap template

https://www.howtosolutions.net/2017/05/visual-studio-asp-net-mvc-project-installing-adminlte-control-panel/

Building elegant applications with ASP.NET MVC Core 2 and Bootstrap 4 using CoreUI

https://www.coderepo.blog/posts/building-elegant-applications-aspnet-mvc-core-2-bootstrap-4-coreui/

ASP.NET Example Version of Beautiful AdminLTE Template https://adminlte-mvc5.azurewebsites.net/

https://github.com/go2ismail/AdminLTE-ASP-NET-MVC

I'm using Visual Studio Community 2015 for the development tools on Windows 10 machine. For this project, I'm using AdminLTE version 2.4.0.

It provides full ASP.NET MVC version of AdminLTE, consisting all the demo pages provided by HTML/JavaScript version of AdminLTE such as:

  • Dashboard
  • Layout
  • Widgets
  • Charts
  • UI Elements
  • Forms
  • Tables
  • Calendar
  • Mailbox
  • Examples
  • Multilevel

You can also learn how to:

  • work with controller
  • work with view
  • work with partial view
  • work with layout
  • work with JavaScript / jQuery
  • work with razor
  • create HTML helper extension

ASP.NET MVC 5 Development Training - 5 days

https://www.intertech.com/Training/Microsoft/Visual-Studio/MVC/ASP-NET-MVC-5-Development

https://cgeers.wordpress.com/2012/09/23/getting-started-with-twitter-bootstrap/

Description

In this course, students will learn to develop advanced ASP.NET MVC applications using .NET Framework tools and technologies. The focus will be on coding activities that enhance the performance and scalability of a web application. ASP.NET MVC will be introduced and compared with Web Forms so that students know when each should/could be used. This course will also prepare the students for exam 70-486.

Learning Objectives

After completing this course, students will be able to:

  • Describe the Microsoft Web Technologies stack and select an appropriate technology to use to develop any given application.
  • Design the architecture and implementation of a web application that will meet a set of functional requirements, user interface requirements, and address business models.
  • Create MVC Models and write code that implements business logic within Model methods, properties, and events.
  • Add Controllers to an MVC Application to manage user interaction, update models, and select and return Views.
  • Create Views in an MVC application that display and edit data and interact with Models and Controllers.
  • Run unit tests and debugging tools against a web application in Visual Studio and configure an application for troubleshooting.
  • Develop a web application that uses the ASP.NET routing engine to present friendly URLs and a logical navigation hierarchy to users.
  • Implement a consistent look and feel, including corporate branding, across an entire MVC web application.
  • Use partial page updates and caching to reduce the network bandwidth used by an application and accelerate responses to user requests.
  • Write JavaScript code that runs on the client side and utilizes the jQuery script library to optimize the responsiveness of an MVC web application.
  • Implement a complete membership system in an MVC web application.
  • Build an MVC application that resists malicious attacks and persists information about users and preferences.
  • Describe how to write a Microsoft Azure web service and call it from and MVC application.
  • Describe what a Web API is and why developers might add a Web API to an application.
  • Modify the way browser requests are handled by an MVC application.
  • Describe how to package and deploy an ASP.NET MVC web application from a development computer to a web server for staging or production.

Audience

This course is intended for professional web developers who use Microsoft Visual Studio in an individual-based or team-based, small-sized to large development environment. Candidates for this course are interested in developing advanced web applications and want to manage the rendered HTML comprehensively. They want to create websites that separate the user interface, data access, and application logic.

Prerequisites

Before attending this course, students must have a minimum of two to three years of experience developing web-based applications by using Microsoft Visual Studio and Microsoft ASP.NET, proficiency in using the .NET Framework, and some familiarity with the C# language.

Course Outline

Delegates, Anonymous Methods, and Lambdas

  • Understand four ways to use delegates
  • Anonymous methods with the delegate keyword
  • Lambda shorthand notation
  • Using Lambdas in ASP.NET MVC 5

Extension Methods, Anonymous Types, and Dynamic Types

  • Understanding extension methods
  • Using extension methods in ASP.NET MVC 5
  • Understanding Anonymous Types
  • Using Anonymous Types in ASP.NET MVC 5
  • Understanding the dynamic keyword
  • Using dynamic Types in ASP.NET MVC 5
  • Introduction to the Task Parallel Library (TPL)
  • Using the TPL in ASP.NET MVC 5

Introduction to LINQ

  • Understand the motivation behind LINQ
  • Visual Studio LINQ support
  • Debugging LINQ query expressions
  • Work with query operators and query expressions
  • Program with LINQ to Objects
  • Understand deferred and immediate execution
  • Know the role of the System.Linq.Enumerable type
  • Know the role of the System.Func delegate type
  • Understanding the query operators / delegates / lambda relationship

Introduction to ASP.NET MVC 5

  • ASP and ASP.NET WebForms
  • One ASP.NET in VS 2013
  • Web Standards and REST
  • JavaScript and Ajax
  • The MVC Design Pattern
  • Unit Testing
  • Managing Dependencies

ASP.NET MVC Architecture

  • ASP.NET Platform
  • Controllers, Models, and Views
  • URL Routing
  • Controller Actions
  • Razor View Engine
  • Extensibility

Defining the Model

  • Persistence Ignorance
  • Repository Pattern
  • Object Relational Mapping (ORM)
  • Entity Framework
  • Using an IoC Container

Routes and URLs

  • Introduction to Routing
  • Defining Routes
  • Route Evaluation
  • The Controller Factory
  • Constraints
  • Exempting URLs
  • Constructing Outgoing URLs
  • Unit Testing Routes

Controllers and Actions

  • IController, ControllerBase, and Controller
  • Defining Actions
  • Action Selectors
  • Action Filters
  • HTTP Verbs
  • HttpContext and RouteData
  • Maintaining Testability
  • Returning Data with ActionResult
  • Parameters and the Model Binder
  • Asynchronous Action Methods

Views

  • View Engines
  • Templates and Scaffolding
  • Bootstrap Framework
  • Razor Syntax
  • ViewData and ViewBag
  • Strongly-Typed Views
  • Layout Pages
  • Custom Sections
  • Partial Views
  • Child Actions
  • Using a ViewModel Object

HTML Helpers

  • Basic Helpers
  • Strongly-Typed Helpers
  • Creating Custom Helpers
  • Declarative Helpers

Data Validation

  • Data Annotations
  • Validation HTML Helpers
  • ModelState
  • IValidatableObject
  • Client Side Validation

Authentication and Authorization

  • ASP.NET Identity
  • Using Windows Authentication
  • Building a Custom Account Controller
  • Configuring Forms Authentication
  • Using the Authorize Attribute
  • Authentication Filters
  • OAuth2 and OpenID

Ajax

  • Controller Actions for Ajax
  • Ajax Helpers
  • Unobtrusive Ajax
  • Ajax with jQuery

Web API 2

  • Using HTTP as an Application Protocol
  • Content Negotiation
  • Routing
  • Attribute Routing
  • ApiController
  • MediaTypeFormatters
  • Cross Origin Resource Sharing (CORS)
  • Open Web Interface for .NET (OWIN)
  • Web API OData

Building a Rich Client-Side UI

  • jQuery UI
  • jQuery Templates

Mobile Clients

  • CSS 3 Media Queries
  • Responsive vs. Adaptive
  • Mobile-Specific Views
  • Using a View Switcher

Customizing and Extending ASP.NET MVC

  • ASP.NET MVC Pipeline
  • Advanced Routing
  • Custom Global Filters
  • Customizing MVC Code Templates
  • Creating a Custom Controller Factory

Deployment

  • Server Requirements
  • Configuration Options

Bootstrap Datetimepicker

March 16, 2018 00:28

Bootstrap Datetimepicker 4 (edit)

https://stackoverflow.com/questions/40035730/bootstrap-date-time-picker

https://stackoverflow.com/questions/23137720/disable-time-in-bootstrap-date-time-picker

https://stackoverflow.com/questions/40035730/bootstrap-date-time-picker

https://stackoverflow.com/questions/23137720/disable-time-in-bootstrap-date-time-picker

https://stackoverflow.com/questions/35778600/bootstrap-datepicker-locale-with-momentjs

https://stackoverflow.com/questions/33918017/bootstrap-datepicker-how-to-use-specific-time-zone

Bootstrap Datetimepicker 3

http://www.skimedic.com/blog/post/2015/04/03/Using-a-DateTime-Picker-for-ASPNET-MVC-5-with-Bootstrap.aspx

http://eonasdan.github.io/bootstrap-datetimepicker/#options

https://stackoverflow.com/questions/40035730/bootstrap-date-time-picker

https://stackoverflow.com/questions/24410685/bootstrap-3-datetimepicker-3-0-0-week-starts-at-monday

https://stackoverflow.com/questions/19382189/change-language-for-bootstrap-datetimepicker

https://stackoverflow.com/questions/22846525/bootstrap-datetimepicker-not-working

Instead of using moment.js I used moment-with-langs.js (I guess it came with default package ASP.NET MVC 5).

By calling:

<script type="text/javascript">
    $('#DateTime').datetimepicker({
        language: "hr"
    });
</script>

thing works, finally the calender starts from monday.

UPDATE: Even better, add key to web.config

<appSettings>    
    <add key="Culture" value="hr" />
</appSettings>

and then

$(document).ready(function () {
    $(document).on('focus', '#Date', function () {
        $(this).datetimepicker({
            locale: '@System.Configuration.ConfigurationManager.AppSettings["Culture"]',
            format: 'DD:MM:YYYY',
        });
    });
});

Dapper Log4net AutoMapper

March 13, 2018 08:35

How to use the Dapper (edit)

- Create new ASP.NET Web Application called WebApplication1 (MVC: Web Forms, MVC, Web API) based on .NET Framework 4.5.2

- Nuget packages:

  + Install-Package log4net

  + Install-Package Dapper

  + Install-Package MySql.Data

  + Install-Package AutoMapper

  + Install-Package Newtonsoft.Json

- Web.config/App.config

  + Define connection string in <connectionStrings> or <appSettings>

- Controllers/HomeController.cs

- Documentation

Dapper with MS SQL Server

- Dapper with raw SQL

 

- Dapper with Stored Procedure

- Sample code

Dapper with MySQL

Nuget notes

+ .NET Framework 4.5
+ ASP.NET MVC 5.2
+ ASP.NET Web API 2.2
+ Web Pages 3.2

Update-Package
Install-Package jQuery -Version 1.12.4
Install-Package Bootstrap -version 3.3.7
Install-Package modernizr
Install-Package Newtonsoft.json
Install-Package log4net
Install-Package Dapper -Version 1.50.2 (.NET Framework 4.5)
Install-Package Microsoft.AspNet.WebApi (-Version 5.2.4)
Install-Package Swashbuckle (-Version 5.6.0)

Web API & Swagger + OAuth2
http://wmpratt.com/swagger-and-asp-net-web-api-part-1/

http://wmpratt.com/part-ii-swagger-and-asp-net-web-api-enabling-oauth2/

https://www.codeproject.com/Articles/1187872/Token-Based-Authentication-for-Web-API-where-Legac

http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/ 

Categories

Recent posts