Table of Content
- Create new app
- Config app and install packages
- Add controllers and views
- Add model and data context,Update database
- Using Layout
- Using Bundle and minification
- Areas
- Identity manager
- Working with static files
<div id="vue-app"> | |
<a v-bind:href="websiteTag">My Site<a/> | |
<br/> | |
<input v-bind:value="name"/> | |
</div> |
//This is a fuction that gets error number and returns error text of MellatBank Gateway methods. | |
public string GetErrorText(string errorId) | |
{ | |
var errorText = "خطای ناشناخته"; | |
switch(errorId) | |
{ | |
case "0": | |
{ | |
errorText = "تراکنش با موفقيت انجام شد"; | |
break; |
Table of Content
In action method of HomeController.cs : | |
[HttpGet] | |
public ActionResult TestAction() | |
{ | |
ViewBag.Categories = db.Categories.ToList(); | |
return View(); | |
} | |
in View (TestAction.cshtml): | |
<select asp-for="Menu.Id" asp-items="@(new SelectList(@ViewBag.Categories,"Id","Title"))"> |
$(dosument).ready(function() | |
{ | |
$.ajax() | |
{ | |
url:'url of action', | |
type:'GET', | |
success: function(data) | |
{ | |
$('#divid').html(data); | |
}, |
$(dosument).ready(function() | |
{ | |
$.ajax() | |
{ | |
url:'url of action', | |
data:{json:data}, | |
type:'POST', | |
success: function() | |
{ | |
alert('done'); |
using System; | |
using System.Drawing; | |
using System.Drawing.Drawing2D; | |
using System.IO; | |
namespace Helpers | |
{ | |
public class ImageHelper | |
{ | |
/// <summary> |
(Another way : https://github.com/tanveery/recaptcha-net) | |
1. Get secret key and site key from : https://www.google.com/recaptcha/admin | |
2. Add them to web config : | |
<add key="recaptcha-secret-key" value="...[secret key]" /> | |
<add key="recaptcha-public-key" value="...[public-key]" /> | |
3. Install Package : | |
PM > Install-Package ReCaptcha-AspNet |
0. Create new console app (dotnet new console) | |
1. Create appsettings.js | |
2. Add this codes to file : | |
{ | |
"ConnectionStrings": | |
{ | |
"SampleConnection": "server=localhost;userid=root;pwd=;port=3305;database=KamranDb3;" | |
} | |
} | |
3. Add this packages using Nuget Package Manager (or just copy this to YourProject.csproj file) : |
0. ASP.NET Core Tutorial for Beginners: | |
http://www.webdevelopmenthelp.net/2017/02/asp-net-core-tutorial-beginners.html | |
0.1 : ASP.Net Core 1.1 - Getting Started Tutorial : | |
http://www.dotnetcurry.com/aspnet/1329/aspnet-core-11-what-is-new | |
1. Drag and Drop file upload in ASP.NET Core : | |
http://www.dotnetawesome.com/2017/02/drag-drop-file-upload-aspnet-mvc.html | |
2. Writing a Blog Engine in ASP.NET Core : |