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的例子,就将差异记录下来
相关文档:
动态页面生成静态页面说起来其实不难,主要是思想的问题,像那些新闻不太常改动的,我们可以将他生成静态的,来提高网站的访问速度,以下就是我的方法,很简单
我们先将我们的动态网站放到网上,并且可以正常访问,然后就是用到了抓取页面的技术了
/// <summary>
/// 获得网页内容
& ......
获取网站根目录的方法有几种如:
Server.MapPath(Request.ServerVariables["PATH_INFO"])
Server.MapPath("/")
Server.MapPath("")
Server.MapPath(".")
Server.MapPath("../")
Server.MapPath("..")
&nb ......
ASP.NET编程模型之ASP.NET页面生命周期图解
ASP.NET编程模型中ASP.NET页面生命周期是指什么呢?它包括什么呢?ASP.NET编程模型之ASP.NET页面生命周期具体的过程有哪些呢?下面就开始我们的讲解吧:
ASP.NET 页运行时,此页将经历一个生命周期,在生命周期中将执行一系列处理步骤。这些步骤包括初始化、实例化控件、还原和 ......
继承"基类"跟继承"接口"都能实现某些相同的功能,但有些接口能够完成的功能是只用基类无法实现的
1.接口用于描述一组类的公共方法/公共属性. 它不实现任何的方法或属性,只是告诉继承它的类
《至少》要实现哪些功能,继承它的类可以增加自己的方法.
2.使用接口可以使继承它的类: 命名统一/规范,易于维护.比如: 两 ......
用Ajax实现Tab效果的
先创建
ajax.php,在其中输入如下代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample 2_1</title>
<me ......