易截截图软件、单文件、免安装、纯绿色、仅160KB

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的例子,就将差异记录下来


相关文档:

asp.net母版页使用控件时,控件中路径问题

刚刚在headmenu控件里面写了一个导航条,用到了本地的图片,在控件中显示良好,可是放到母版式页后,发现导航条背景图片没了,于是仔细检查了下图片的url,我用的是绝对路径,难道放在主页上后,路径也改变了,上网查了下,还真是这个问题,图片在控件里面看不到没关系,关键是要在母版式页能看到就行,路径都要根据母版页的写. ......

asp.net中用法总结——个人

1:在.aspx页面,<% %>标签相当于在.cs页面的代码,也就是说你在.cs文件里面怎样写,就可以在.aspx文件里面的<% %>标签里面怎样写。
2:在.aspx页面,<%= %>标签可以调用你的后台的变量或者方法等,不过被调用的方法必须是public的。
如果你的Default.cs文件里面有:
public string str = "调用后台方 ......

AJAX中文乱码的两类问题解决方法

1)发送路径中的参数有中文,在服务器端接收参数值是乱码
解决方法:
PHP:
服务器端:iconv("UTF-8","gb2312",$_POST[变量名]);
JSP:
客户端:
利用javascript的提供的escape()或encodeURI()方法, 例
var url="a.jsp?name=小李";
url=encodeURI(url);
url=encodeURI(url); //两次,很关键[具体为什么,我也不清楚 ......

AJAX里TabContainer的CSS (转贴)

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. ......

PHP+Ajax实现Tab效果

用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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号