Asp.net AJAX Web Service写法差异
在C#中
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
using System.Collections.Generic;
using System.Collections;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[GenerateScriptType(typeof(Employee ))]
[ScriptService]
public class PeopleManagementService : System.Web.Services.WebService
{
[WebMethod]
[ScriptMethod(UseHttpGet = true)]
public Employee CreateNewEmployee()
{
return new Employee();
}
}
vb.net
Imports System;
Imports System.Web;
Imports System.Web.Services;
Imports System.Web.Services.Protocols;
Imports System.Web.Script.Services;
Imports System.Collections.Generic;
Imports System.Collections;
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<GenerateScriptType(GetType(Employee))> _
<ScriptService()> _
Public Class PeopleManagementService
Inherits System.Web.Services.WebService
<WebMethod()> _
<ScriptMethod(usehttpget:=True)> _
Public Function CreateNewEmployee() As Employee
Return New Employee()
End Function
End Class
C#中的static,对应vb.net shared
因为自己基本上使用的vb.net,看的资料又基本上是C#的,很少的vb.net的例子,就将差异记录下来
相关文档:
获取网站根目录的方法有几种如:
Server.MapPath(Request.ServerVariables["PATH_INFO"])
Server.MapPath("/")
Server.MapPath("")
Server.MapPath(".")
Server.MapPath("../")
Server.MapPath("..")
&nb ......
对于开发者自身的机器来讲,可能程序运行不会有任何问题,但关键是,程序往往要发布到用户的机器上,如果用户有专门的服务器,那另当别论,但如果用户只是想用一台普通不能在普通的办公机器当服务器的话,发布程序,可能就要做的事情多一些:
1、首先检查系统有没有安装iis,如果没有,要上网下载iis的安装包,通过“ ......
在使用jQuery 的Ajax加载数据是 如果使用get方式传递参数则存在一下问题
firefox下传递数据正常
ie下则会出现缓存问题
解决方法:
1、http://yourwebsite?parseInt(Math.random() * 1000) 在url后面加上一个随即数,这样每次发送的就不一样了,而且不影响你的功能.
2、使用post传递参数
......
jQuery学习笔记
提交form表单之后,不会刷新页面,而是局部刷新,欲提交的form只要有id即可
如果使用get请求,注意中文乱码问题,jquery会先使用iso8859-1解码,然后发给服务器,如果使用post请求,则直接将中文内容提交给服务器解析。
使用jquery-1.4.2.js和jquery.form.js插件。
如果创建新的js文件中,需要加上
doc ......
如上图所示的等级控件(这个控件主要指定样式):
页面代码:
<head runat="server">
<title>无标题页</title>
<mce:style type ="text/css"><!--
.ratingStar
{
font-size:0pt;
width:15px;
height:12px;
......