DevExtreme 学习应用[2]
DevExtreme 学习应用[2]
调用WebService数据

1那么首先建立WebService
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services; namespace WebService
{
/// <summary>
/// WebService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
//以上这句要有 不然会报错 因为手机开发一般是要以Json形式获取数据
public class WebService : System.Web.Services.WebService
{ [WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}
2HTML
<div data-bind="dxCommand: {
title: 'Search', placeholder: 'Search...',
location: 'create', icon: 'btn',value:'button', action: find
}"></div>
3JavaScript 该JS是以Jquery的形式调用的。所以只要做过Jquery的都比较清楚
Application1.ProductDetial = function (params) {
var viewModel = {
find: function () {
$.ajax({
url: 'http://localhost:5421/WebService/WebService.asmx/HelloWorld',
data: {},
//data:{} 因为我们在这里测试的使用的HelloWord 方法是无参的。所以这里为空。要是有参数的方法 如参数为Name:data:{name:'李四'} 备注:这里的参数名 最好和服务端的参数名称一致
contentType: "application/json",
dataType: "json",
type: "POST",
success: function (result) {
alert(result.d);
},
error: function (xml, status) {
alert(status);
}
});
}
};
return viewModel;
};
总结:DevExtreme 开发中调试通了 调用C# WebService的方法。
DevExtreme 学习应用[2]的更多相关文章
- DevExtreme 学习应用[1]
DevExtreme学习开发 [1] 用HTML开发手机应用,看一哈帮助文档觉得还很不错. 在开发前一定要安装DevExteme 下载连接地址: ftp://211.101.1.108/DevExp ...
- DevExtreme 学习应用[3]
DevExtreme dxSelectBox 联动查询案例 //数据获取 lookupDataSource = new DevExpress.data.DataSource({ store: stor ...
- DevExtreme学习笔记(一) DataGrid中MVC分析
@(Html.DevExtreme().DataGrid() .ID("gridContainer") .DataSource(d => d .OData() .Url(&q ...
- DevExtreme学习笔记(一)treeView(搜索固定、节点展开和收缩)注意事项
var treeConfig1 = dxConfig.treeView(obj_Question.treeDataSource1); treeConfig1.selectionMode = 'sing ...
- DevExtreme学习笔记(一) DataGrid中数据提交注意事项
1.数据提交的{}数据需转化json格式 syncPost('/controller/action', { values: JSON.stringify({d:x}) }, function (res ...
- DevExtreme学习笔记(一) DataGrid中数据筛选
config.filterRow = { visible: true, applyFilter: "auto" }; config.headerFilter = { visible ...
- DevExtreme学习笔记(一) DataGrid中注意事项
1.阻止cell编辑 config.onEditorPreparing = function (e) { if (e.dataField === 'xx' && e.row.data. ...
- DevExtreme学习笔记(一) DataGrid中js分析
1.overviewjs采用 $(function() { $("#gridContainer").dxDataGrid({ dataSource: { store: { type ...
- ABP 基于DDD的.NET开发框架 学习(五)中使用DevExpress插件
1.DevExpress安装 安装步骤1:开始安装 安装步骤2:选择需要安装的模块 安装步骤3:修改安装路径 安装步骤4:正在安装 安装步骤5:安装完成 2.Vs中设置 1)DevExtremeBun ...
随机推荐
- 使用 SoapUI 测试ASP.NET Web API
我们为不同的目的开发了很多web服务,经过授权的用户就可以访问和使用这些web服务.soapUI 是一个强大的测试web服务的工具,他不仅可以测试SOAP服务,他也支持测试RESTful服务.在这里我 ...
- IIS Community Newsletter June 2013
Announcements Windows 2012 Server R2 preview released Windows Server 2012 R2 provides a wide range o ...
- Lesson 12 Goodby and good luck
Text Our neighbour, Captain Charles Alison, will sail from Portsmouth tomorrow. We'll meet him at th ...
- Fd.Service 轻量级WebApi框架
News December 06 2014: Version 1.0.0.8Add Register Route Configuration iis 7 Integrated Mode: <sy ...
- EF:The provider did not return a ProviderManifest instance
报告错误1:指定的存储区提供程序在配置中找不到,或者无效. 报告错误2:System.Data.ProviderIncompatibleException: The provider did not ...
- Linux下MongoDB服务安装
Linux下MongoDB服务安装 MongoDB是一个基于分布式文件存储的数据库.由C++语言编写.旨在为WEB应用提供可扩展的高性能数据存储解决方案.MongoDB是一个介于关系数据库和非关系数据 ...
- Elasticsearch 5.0 —— Head插件部署指南
使用ES的基本都会使用过head,但是版本升级到5.0后,head插件就不好使了.下面就看看如何在5.0中启动Head插件吧! 官方粗略教程 Running with built in server ...
- 几个最常用的用来代替Div的HTML5元素
虽说html5中大多数功能性的元素如<video><canvas><audio>等还得不到当前主流浏览器的支持(主要就是指IE浏览器了),但至少那些个与布局相关的元 ...
- Sublime 快捷键
语法快捷键: 后代:> 缩写:nav>ul>li <nav> <ul> <li></li> </ul> </nav& ...
- 彻底理解nth-child和nth-of-type的区别。
最近又有些天没写博客了,主要写一篇下来,太浪费时间了,其实这不是根本,根本是最近比较忙,忙什么呢?最近发现一个问题觉得学习速度太慢了,时间倒是花的很多,但大部分时间都花在无意义的事情上,所有打算改变政 ...