これまで皆様のご協力ありがとうございました!これまでのところ、このサイトで本当に役に立つ答えがありました。だから私はもう1つを望んでいる。asp.net動的リストボックス「データの取得中にエラーが発生しました」
私が作成したいのは正確にはですが、まだ問題があります。私はhtmlと単語のためのJavaScriptの単語をコピーして、index.htmlのように、そのファイルを保存した(ただし、明らかに開閉htmlと体のタグ付き)している
http://www.webonweboff.com/widgets/ajax/ajax_linked_selection.aspx
私は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と呼ばれているファイルを次のコードを持っています
ダウンロードして保存した他の(.js)ファイル。 .htmlファイルを実行すると、次のエラーが表示されます。
データの取得中にエラーが発生しました。
URL:ajaxServer.asp
方法:GET
のparams:アクション=国家、文化= EN-US
readyStateの:4
状況:403の
ヘッダ:サーバー:ASP.NET開発サーバー/ 10.0.0.0 日付:Sun、19 Jun 2011 20:39:55 GMT X-AspNet-バージョン:4.0.30319 キャッシュ制御:専用 コンテンツタイプ:text/html; charset = utf-8 コンテンツの長さ:2126 接続:閉じる
- >手がかりはありますか?もう一度 - 事前にすべての助けをありがとう!
Ah-Ha!だから今私のエラーは消えてしまったが、私は2つのボックスを(例のように)得るが、私の2番目のボックスは常に空白である... :( – Joe