私はJSONの初心者です。PHPとjQuery(http://wil-linssen.com/entry/extending-the- jquery-sortable-with-ajax-mysql /)を使用します。C#メソッドへのjQuery/JSON/PHPオブジェクト
私がしようとしているのは、上記の例でPHPで使用されているのとまったく同じように、シリアライズされた「オーダー」オブジェクトをC#メソッドで使用することです。
だから、jQueryのコードは次のとおりです。私はまったく同じことをしたいと思っ
<?php
/* This is where you would inject your sql into the database
but we're just going to format it and send it back
*/
foreach ($_GET['listItem'] as $position => $item) :
$sql[] = "UPDATE `table` SET `position` = $position WHERE `id` = $item";
endforeach;
print_r ($sql);
?>
:代わりのようにPHPで処理するハンドラに「注文」オブジェクトを渡すの
<script type="text/javascript">
// When the document is ready set up our sortable with it's inherant function(s)
$(document).ready(function() {
$("#test-list").sortable({
handle : '.handle',
update : function() {
var order = $('#test-list').sortable('serialize');
$("#info").load("process-sortable.php?"+order);
}
});
});
</script>
C#4.0を使用して、同じページにあるメソッドのオブジェクトで作業します。これは可能ですか?誰かが私にこれを行う方法を教えてくれますか?
EDIT: 私は4
本当にありがとうございましたASP.NET Webフォーム& C#を使用しています!
これは、使用しているASP.NETのバージョンによって異なります。 WebFormsまたはMVC? – mccow002
私はASP.NET WebFormsを使用しています – Jared