dotNet
- 授权协议: 未知
- 开发语言:
- 操作系统: 未知
- 软件首页: http://plugins.jquery.com/project/dotNet
软件介绍
This plugin is a jQuery 1.2.6 shortcut to the call Web Services or Page Methods under .NET Framework.
With this plugin you can develop AJAX sites under .NET easier than ever, with an EXCEPTIONAL performance!.
I tested this plugin with the JSON.NET framework http://www.codeplex.com/Json. I used this framework, because is very flexible with the JSON output.
Usage:
// I use no conflict because the AJAX ASP.NET Framework Client API
// overrides the $ function.
jQuery.noConflict();
// Execute all when the document is ready.
jQuery(document).ready(function($) {
// private function for debugging
function debug(log) {
if (window.console && window.console.log)
window.console.log(log);
};
/*
* Simpliest call
*/
$.callDotNet("Service.asmx/GetExample", function(result) {
debug(result);
});
/*
* Here we can define a global error handler to the plugin, and data
*/
// WebService URL
var wsUrl = "Service.asmx/GetExampleData";
// Data
var data = "{pageNumber: 1, pageSize: 20, sortColumn: \"FirstName\", sortDirection: \"ASC\"}";
// Global Error Handler for AJAX requests
$.callDotNet.onError = function(error) {
alert("Run away!!!");
}
// The call back method.
function onSuccess(result) {
debug(result);
}
// And fanally the call to the web service
$.callDotNet(wsUrl, data, onSuccess);
});
And a Web Service like:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;
using System.Web.Script.Services;
using System.Web.Services;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
[WebMethod]
public string GetExampleData(int pageNumber, int pageSize, string sortColumn, string sortDirection)
{
List list = new List();
for(int i = 0; i < 30; i++)
{
list.Add(new Example());
}
return JavaScriptConvert.SerializeObject(list, new IsoDateTimeConverter());
}
[WebMethod]
public string GetExample()
{
return JavaScriptConvert.SerializeObject(new Example());
}
[JsonObject(MemberSerialization.OptIn)]
public class Example
{
[JsonProperty]
public string FirstName;
[JsonProperty]
public string LastName;
[JsonProperty]
public string Address;
[JsonProperty]
public DateTime Created = DateTime.Now;
public Example()
{
FirstName = new String('-', 10);
LastName = new String('*', 10);
Address = new String(':', 10);
}
}
}
I hope you like it,
and Happy Coding!
轻量级Django
茱莉亚·埃尔曼 (Julia Elman)、马克·拉温 (Mark Lavin) / 侯荣涛、吴磊 / 中国电力出版社; 第1版 / 2016-11-1 / 35.6
自Django 创建以来,各种各样的开源社区已经构建了很多Web 框架,比如JavaScript 社区创建的Angular.js 、Ember.js 和Backbone.js 之类面向前端的Web 框架,它们是现代Web 开发中的先驱。Django 从哪里入手来适应这些框架呢?我们如何将客户端MVC 框架整合成为当前的Django 基础架构? 本书讲述如何利用Django 强大的“自支持”功......一起来看看 《轻量级Django》 这本书的介绍吧!
XML、JSON 在线转换
在线XML、JSON转换工具
Markdown 在线编辑器
Markdown 在线编辑器
