謝謝大家的幫助!到目前爲止,在這個網站上有一些真正有用的答案,所以我希望再多一次。.aspx文件幫助
我想創建也正是這一點,但我仍然有問題
http://www.webonweboff.com/widgets/ajax/ajax_linked_selection.aspx
我抄HTML和JavaScript的詞字,並保存該文件作爲index.html的(但顯然與開閉html和body標籤)
的文件我已經叫ajaxServer.aspx.cs具有下面的代碼:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "text/javascript";
string id = Request.QueryString.Get("id");
string action = Request.QueryString.Get("action");
StringBuilder returnString = new StringBuilder();
/*
Retrieve the data based on values "id" and "action"
and build a response string in this format:
[{text:"...",
*
* value:"...",selected:false},
{text...}]
No final ";" is necessary
For example:
returnString.Append("[{text:\"California\",value:\"CA\",selected:false}," +
"{text:\"OH\",value:\"Ohio\",selected:false}," +
"{text:\"NY\",value:\"New York\",selected:true}]");
*/
Response.Write(returnString.ToString());
}
}
我已經叫ajaxServer.aspx文件中有如下代碼:
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="ajaxServer.aspx.cs" Inherits="_Default" %>
其他(.js文件)我已經下載並保存的文件。當我運行.html文件時出現以下錯誤:
錯誤提取數據!
網址:ajaxServer.asp
方法:GET
PARAMS:動作=狀態,文化= EN-US
的readyState:4
狀態:403
頭:服務器:ASP.NET Development Server/10.0.0.0 日期:Sun,19 Jun 2011 20:39:55 GMT X-AspNet-Version:4.0.30319 Cache-Control:private Content-Type:text/html; charset = utf-8 內容長度:2126 連接:關閉
- >任何線索任何人?再一次感謝您提前提供的所有幫助!
回答後不要刪除問題。它可能會幫助其他人在未來 – citronas