<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head>
<card title="asp.net与JQuery和Json" id="card1">
<p> 游客</p><p>
标题:asp.net与JQuery和Json<br/>
正文:<br/>
 折腾了两三天的Json格式数据，从Asp.net返回的时候，始终无法转换为Json格式，使用eval函数进行转换的时候，总是提醒无分号，经过大量的修改和测试，有时又提醒没有），下载JsonExSerializer进行序列化也不行，存在同样的问题。最后总算发现问题出在Asp.net返回数据上。由于没有使用的是Asp.net的前台展示文件.aspx和后台代码文件分离的格式，在.aspx文件中，存在有其他代码，虽然显示不出来，但是在返回的过程中，连同json数据一块返回了，如&amp;lt;html&amp;gt;等等。将.aspx中的其他内容均删除，只保留文件头：&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeFile=&amp;quot;ipAddress.aspx.cs&amp;quot; Inherits=&amp;quot;zonghe_ipAddress&amp;quot; %&amp;gt;，删除visual stdio.net自动生成的页面内容：&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; &amp;gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;    &amp;lt;title&amp;gt;无标题页&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;    &amp;lt;div&amp;gt;       &amp;lt;/div&amp;gt;    &amp;lt;/form&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;这样，在返回<br/><a href="http://www.zhongguosou.com/blog/wap.asp?mode=WAP&amp;act=View&amp;id=474&amp;Page=1">[&lt;&lt;]</a><a href="http://www.zhongguosou.com/blog/wap.asp?mode=WAP&amp;act=View&amp;id=474&amp;Page=1">[[1]]</a><a href="http://www.zhongguosou.com/blog/wap.asp?mode=WAP&amp;act=View&amp;id=474&amp;Page=2">[2]</a><a href="http://www.zhongguosou.com/blog/wap.asp?mode=WAP&amp;act=View&amp;id=474&amp;Page=2">[&gt;&gt;]</a><br/>
<br/>
<a href="wap.asp?act=Com&amp;id=474">查看评论(0)</a><br/>
<a href="wap.asp?act=AddCom&amp;inpId=474">发表评论</a><br/><br/>

<br/>

<br/>
<a href="http://www.zhongguosou.com/blog/wap.asp">首页</a>
</p>
</card>
</wml>