自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

苦丁香的CSDN博客

追随.NET Core

  • 博客(6)
  • 收藏
  • 关注

原创 如何在客户端生成GUID(Javascript)

function S4() { return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);}function guid() { return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()

2017-02-10 13:23:42 583

原创 $.ajax中contentType: “application/json” 的用法

不使用contentType: “application/json”则data可以是对象$.ajax({url: actionurl,type: "POST",datType: "JSON",data: { id: nodeId },async: false,success: function () {}});使用contentType: “application/json”则data

2017-02-10 13:23:00 59216 3

原创 如何将JSON对象传递给Controller进行处理

Step 1. 利用jQuery的Ajax方法发送JSON数据$.ajax({url: "/[Controller]/[Action]",type: "POST",contentType: "application/json; charset=utf-8",dataType: "json",data: JSON.stringify([JSON Data]),async: true,su

2017-02-10 13:22:20 9588

原创 如何在Controller 中获取JSON文件的内容

Step1. 获取JSON文件路径1.在Controller文件中添加引用using Microsoft.AspNetCore.Hosting;2.为Controller类添加私有成员private IHostingEnvironment hostingEnvironment;3.在构造函数中为成员赋值public [Controller](IHostingEnvironment env){

2017-02-10 13:21:01 4101

原创 如何在客户端接收Action返回的JSON数据

Step1. 返回JSON数据的Actionpublic JsonResult [Action](){ return Json([object]);}Step2. 使用jQuery的getJSON获取JSON数据var jsonURL = "/[Controller]/[Action]";$.getJSON(jsonURL, function (data) { // 调用 da

2017-02-10 13:18:50 2454

原创 ASP.NET Core 如何上传单个文件

ASP.NET Core 如何上传单个文件分为以下三个步骤:设置Form属性修改Controller设置Action处理POST请求第一步:设置Form属性<form id="form1" action="/[Controller]/[Action]" enctype="multipart/form-data" method="post" name="form1"> <input n

2017-02-10 13:10:37 7853 2

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除