asp.net + jquery+json 的简单实例
这里是我的一个简单的jquery+json的连库操作,只是一个简单查询,
//后台代码
<%@ WebHandler Language="C#" Class="show" %>
using System;
using System.Web;
using System.Collections.Generic;
using Model;
using DAL;
using System.Web.Script.Serialization;
public class show : IHttpHandler {
public void ProcessRequest (HttpContext context) {
JavaScriptSerializer serializer=new JavaScriptSerializer();
//调用后台方法
IList<test> tt = testservice.getalltest();
//序列化
string date= serializer.Serialize(tt);
context.Response.ContentType = "text/plain";
context.Response.Write(date);
}
public bool IsReusable {
get {
return false;
}
}
}
//前台代码
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
<script src="js/jquery.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
&n
相关文档:
asp.net 将Excel导入到Sql2005或2000的思路和步骤:
1、将Excel文件上传到服务器端
这个我不想详细讲了,网上一搜一大把的.
注意:(1在取服务器路径时一定要用this.Page.MapPath(".")而不要用 this.Page.Request.Applic ......
在上一篇博文《asp.net中的身份验证(最简单篇)》中的身份验证虽然很简单,但是有一个缺点,就是访问整个网站都必须要经过身份验证,而事实上,很多网站都不会这么要求的。
比如一个新闻系统,通常只有在发布新闻的网页才需要身份验证,而用户浏览新闻是不需要身份验证的。对于这种情况,就要针对不同的网页来进行身份验 ......
一、认识Web.config文件
Web.config文件是一个XML文本文件,它用来储存 ASP.NET Web 应用程序的配置信息(如最常用的设置ASP.NET Web 应用程序的身份验证方式),它可以出现在应用程序的每一个目录中。当你通过VB.NET新建一个Web应用程序后,默认情况下会在根目录自动创建一个默认的
Web.config文件,包括默认的配置设置 ......
测试的url地址是http://www.test.com/testweb/default.aspx, 结果如下:
Request.ApplicationPath: /testweb
Request.CurrentExecutionFilePath: /testweb/default.aspx
Request.FilePath: /testweb/defa ......