0

私は2つのリストボックス(AとBを考慮)を持っており、右に移動してボタンを保存します

  1. jqueryを使用して、最初にデータをAからBに移動します。これは、右に移動するために使用したコードです。

    $(function () {
    
        $('#addCat').click(function () {
            $(".ListBox1 > option:selected").appendTo(".ListBox2");
            sortlist(".ListBox1 > option");
            sortlist(".ListBox2 > option");
            selectAll();
        });
    
    
        $('#removeCat').click(function () {
            $(".ListBox2 > option:selected").appendTo(".ListBox1");
            sortlist(".ListBox1 > option");
            sortlist(".ListBox2 > option");
            selectAll();
    
    
        });
        $('#addCount').click(function () {
            $(".ListBox3 > option:selected").appendTo(".ListBox4");
            sortlist(".ListBox3 > option");
            sortlist(".ListBox4 > option");
            selectAll();
        });
        $('#removeCount').click(function () {
            $(".ListBox4 > option:selected").appendTo(".ListBox3");
            sortlist(".ListBox3 > option");
            sortlist(".ListBox4 > option");
    
        });
    
    
        $('.submit').click(function () {
            //selectAll();
            return newAccountValidate();
    
    
        });
    
    
    
        $('.save').click(function () {
            //selectAll();
            return editAccountValidation();
        });
    
    
    
    
    });
    
  2. 次に、[保存]ボタンをクリックします。コードビハインド(サーバー側)からリストボックスBからアイテムを取得しようとしていますが、アイテムを取得できず、アイテム数も0です。

リストボックスbitems.count=0を取得します

専門家はこの問題を解決する方法を教えてください。

4

1 に答える 1

0

JQueryによって行われたすべての変更は、サーバーに変換されません。これは、JQuery $ .ajaxを使用して変更をサーバーにプッシュバックするか、リストボックス2の非表示フィールドなどに値を格納する必要があることを意味します。2番目のオプション(非表示フィールドに保存)では、基本的に、リスト1と2の間の変更を追跡します...

これは、クライアントとサーバーの相互作用の問題になる可能性があります。

于 2012-10-11T14:33:43.203 に答える