PDA

View Full Version : Ext.grid.Panel



feva
24 Oct 2011, 8:44 AM
I'm sorry, my English is poor. :)
When I saving data to server, I have a question:
I DEV. with ASP, not ASP.NET.

I had find JSON.org

ASP:

JSON for ASP (http://code.google.com/p/aspjson/).
JSON ASP utility class (http://www.webdevbros.net/2007/04/26/generate-json-from-asp-datatypes/).
I wanna :

Response.Write(Request), But It's Wrong. The request data is gibberish.

The charset is utf-8.
Option Explicit
Server.ScriptTimeOut = 999
Response.Buffer = True
'Response.ContentType = "text/html"
Response.ContentType = "text/json"
Response.CodePage = 65001
Response.CharSet = "utf-8"
Session.CodePage = 65001
Session.LCID = 2052'Chinsese


If action = "update" Then
Response.Write Request.BinaryRead(Request.TotalBytes)
Response.Flush
Response.End
End If

My mean: Just like xmlHttp.load(Request)

skirtle
24 Oct 2011, 9:08 AM
I don't believe this question has anything to do with ExtJS.

feva
24 Oct 2011, 9:23 AM
help

Ext.grid.Panel:proxy: {
type: 'ajax',
method: 'POST',
headers: { 'Content-Type': 'application/json; charset=utf-8'},
api: {
read: 'data/admin.asp?action=read',
update: 'data/admin.asp?action=update'
},
reader: {
type: 'json',
root: 'admin',
totalProperty: 'totalCount',
successProperty: 'success'
}
}

??????????


Date
Mon, 24 Oct 2011 17:20:29 GMT


Server
Microsoft-IIS/6.0


X-Powered-By
ASP.NET


Content-Length
81


Content-Type
application/json; Charset=utf-8


Cache-Control
private



??????????


Host
localhost


User-Agent
Mozilla/5.0 (Windows; U; Windows NT 5.2; zh-CN; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16


Accept
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8


Accept-Language
zh-cn,zh;q=0.5


Accept-Encoding
gzip,deflate


Accept-Charset
GB2312,utf-8;q=0.7,*;q=0.7


Keep-Alive
115


Connection
keep-alive


Content-Type
application/json; charset=utf-8


X-Requested-With
XMLHttpRequest


Referer
http://localhost/WebManager/admin.html


Content-Length
54


Cookie
ASPSESSIONIDASCBBTRA=KHMPPILCANIBDCFKIAPAFCJL


Pragma
no-cache


Cache-Control
no-cache

skirtle
24 Oct 2011, 9:34 AM
Please use CODE tags when posting code (# button on the editor toolbar).

Use Firebug to check the POST body. Does it appear to be correct that point?

feva
24 Oct 2011, 9:43 AM
Ext is correct.

First step:
Convert a binary data (BinaryRead) to a string by ASP

http://www.motobit.com/tips/detpg_binarytostring/

(http://www.motobit.com/tips/detpg_binarytostring/)Then derialize it to ASP Object, in order to ASP read it.

Parse JOSN to Object
http://www.oschina.net/code/snippet_102826_1331?from=rss

(http://www.oschina.net/code/snippet_102826_1331?from=rss)