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的例子,就将差异记录下来
相关文档:
刚刚在headmenu控件里面写了一个导航条,用到了本地的图片,在控件中显示良好,可是放到母版式页后,发现导航条背景图片没了,于是仔细检查了下图片的url,我用的是绝对路径,难道放在主页上后,路径也改变了,上网查了下,还真是这个问题,图片在控件里面看不到没关系,关键是要在母版式页能看到就行,路径都要根据母版页的写. ......
ASP.NET编程模型之ASP.NET页面生命周期图解
ASP.NET编程模型中ASP.NET页面生命周期是指什么呢?它包括什么呢?ASP.NET编程模型之ASP.NET页面生命周期具体的过程有哪些呢?下面就开始我们的讲解吧:
ASP.NET 页运行时,此页将经历一个生命周期,在生命周期中将执行一系列处理步骤。这些步骤包括初始化、实例化控件、还原和 ......
1)发送路径中的参数有中文,在服务器端接收参数值是乱码
解决方法:
PHP:
服务器端:iconv("UTF-8","gb2312",$_POST[变量名]);
JSP:
客户端:
利用javascript的提供的escape()或encodeURI()方法, 例
var url="a.jsp?name=小李";
url=encodeURI(url);
url=encodeURI(url); //两次,很关键[具体为什么,我也不清楚 ......
AJAX自从引进了Tab,着实让我开心了一番。但是,在调整Tab的样式的时候,也着实让我吃了一惊。
于是,抱着没有困难也要制造困难的原则,开始了征途:
按照Tab作者Ronald Buckton所说,Tab的CSS包含如下几个类:
(1).ajax__tab_header: A container element that wraps all of the tabs at the top of the TabContainer.
......
MainPage文件:WebForm1.aspx
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="TestMasterPage.WebForm1" enableViewState="False"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML> ......