Ajax 问题,请大家帮一下.
1.修改groupcontribution的主键,改为groupcode,deptcode,mon,
2.修改staff_info,加字段skill,groupCOde:
alter table staff_info alter column skill varchar(50);
alter table staff_info alter column skill varchar(50);
3.group_info增加ischeck字段,并先改为1:
update group_info set ischeck = 1
4.把staff_info表中的数据导入accounts_users:
insert into accounts_users (UserCode,EmployeeCode,EmployeeName,DeptCode,GroupCode,Position,IsEngage,Skill,Bak,PX)
select 'new'+ EmployeeCode,EmployeeCode,EmployeeName,DeptCode,GroupCode,Position,IsEngage,Skill,Bak,PX from staff_info
update accounts_users set Gender = 1
5.Accounts_Roles 中,RoleID 改为不自增,并为主键
6.ccounts_users表中,把员工改为6,班组长该为5,
update accounts_users set Position='5' where Position ='班组长'
update accounts_users set Position='6' where Position ='员工'
7.导数据
insert into accounts_users ([UserCode],[EmployeeCode],[EmployeeName],[Gender],[Birthday],[GroupCode],[DeptCode],
[Position],[IsMonitor],[IsEngage],[Skill],[Bak],[academic],[JobTime],[WorkTime])
select [UserCode],
convert(varchar(20),cast(convert(float,[EmployeeCode]) as decimal)),
[EmployeeName],[Gender],
convert(varchar(10),[Birthday],120),
[GroupCode],[DeptCode],
[Position],[IsMonitor],[IsEngage],[Skill],[Bak],[academic],
convert(varchar(7),[JobTime],120),
convert(varchar(7),[WorkTime],120)
from 员工信息$
用vs2008开发ajax ,作了一个测试,编译能通过,但怎么也跑不通?源码如下:
1.类Test:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
namespace aaa
{
/// <summary>
///Apple 的摘要说明
/// </summary>
public class Test
{
public Test()
{
//
//TODO: 在此处添加构造函数逻辑
//
}
[AjaxPro.AjaxMethod]
public DateTime GetServerTime()
{
return DateTime.Now;
}
}
}
2.调用页面:
using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(aaa.Test));
}
}
3.客户端:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 runat="server">
<title>无标题页</title>
<script type="text/javascript" language="javascript">
function getServerTime()
{
aaa.Test.GetServerTime(getServerTime_callback); // asynchronous call
}
// This method will be called after the method has been executed
// and the result has been sent to the client.
function getServerTime_callback(res)
{
alert(res.value);
}
getServerTime();
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
4.配置文件:
<?xml version="1.0"?>
<!--
注意: 除了手动编辑此文件以外,您还可以使用
Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
“网站”->“Asp.Net 配置”选项。
设置和注释的完整列表在
machine.config.comments 中,该文件通常位于
\Windows\Microsoft.Net\Framework\v2.x\Config 中
-->
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<httpHandlers>
<add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
</httpHandlers>
<!--
设置 compilation debug="true" 可将调试符号插入
已编译的页面中。但由于这会
影响性能,因此只在开发过程中将此值
设置为 true。
-->
<compilation debug="true">
</compilation>
<!--
通过 <authentication> 节可以配置 ASP.NET 用来
识别进入用户的
安全身份验证模式。
-->
<authentication mode="Windows"/>
<!--
如果在执行请求的过程中出现未处理的错误,
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
<system.codedom>
</system.codedom>
<!--
在 Internet 信息服务 7.0 下运行 ASP.NET AJAX 需要 system.webServer
节。对早期版本的 IIS 来说则不需要此节。
-->
<system.webServer>
</system.webServer>
</configuration>
5.其他:
引用的是AjaxPro.2.dll.
运行提示: Microsoft JScript runtime error: 'aaa' is undefined;
上面的是按网上的资料作的,在vs2008中,选framework 2.0。 在Msdn 查AjaxPro.Utility.RegisterTypeForAjax,没有找到,是否现在用法已变了。