こんにちは私はaspxファイルにデータを送信するためにjQuery AJAXを使用しています。メソッドのjsonデータをポストし、aspxファイルで受信
$(document).ready(function() {
$('#openfuckingmodal').click(function() {
var id = $(this).attr('data-id');
$.ajax({
type: "POST",
url: "Video.aspx",
contentType: "application/x-www-form-urlencoded; charset=utf-8",
data: {
"videoid": "id"
},
dataType: "json",
success: function(resultData) {
console.log(resultData);
},
error: function(errordata) {
console.log(errordata);
}
});
});
});
マイaspx.cs
protected void Page_Load(object sender, EventArgs e) {
string query = Request.QueryString[0];
if (query != null) {
if (!IsPostBack) {
gvShow.DataSource = VideoBL.GetVideo(query);
gvShow.DataBind();
}
}
}
しかし、私はこのエラーを取得しておく:ここに私のAJAXはある
System.ArgumentOutOfRangeException
An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.