2017-05-13 20 views
0

私のアプリケーションでは、マルチ選択でドロップダウンする必要があります。リンクの下の複数選択のドロップダウンが機能していて、日付選択ツールが機能していないとマルチ選択が機能しない場合、日付ピッカーが機能しない

http://www.codingfusion.com/Post/Dropdownlist-with-checkboxes-in-asp-netと、この複数選択と一緒に私もしてドロップダウンした場合に問題がある私は、このリンクでコードを使用していたそのためのテキストボックス

https://www.aspsnippets.com/Articles/DateTimePicker-control-for-ASPNet-TextBox-Example.aspx

の日付ピッカーを持っている必要があります複数の選択日付ピッカーが機能していない場合、日付ピッケrは複数選択がどのように機能していない働いている私はこの問題を解決することができます誰も私を助けてissue.can

日付ピッカーコード

<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> 
<script src="Scripts/jquery.dynDateTime.min.js" type="text/javascript"></script> 
<script src="Scripts/calendar-en.min.js" type="text/javascript"></script> 
<link href="Styles/calendar-blue.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript"> 
    $(document).ready(function() { 
     $("#<%=TextBox1.ClientID %>").dynDateTime({ 
      showsTime: true, 
      ifFormat: "%Y/%m/%d %H:%M", 
      daFormat: "%l;%M %p, %e %m, %Y", 
      align: "BR", 
      electric: false, 
      singleClick: false, 
      displayArea: ".siblings('.dtcDisplayArea')", 
      button: ".next()" 
     }); 
    }); 
</script> 


<asp:TextBox ID="TextBox1" runat="server" ReadOnly = "true"></asp:TextBox> 
<img src="calender.png" /> 

マルチ選択コード

<asp:listbox runat="server" id="lstBoxTest" selectionmode="Multiple"> 
     <asp:listitem text="Red" value="0"></asp:listitem> 
     <asp:listitem text="Green" value="1"></asp:listitem> 
     <asp:listitem text="Yellow" value="2"></asp:listitem> 
     <asp:listitem text="Blue" value="3"></asp:listitem> 
     <asp:listitem text="Black" value="4"></asp:listitem> 
    </asp:listbox> 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> 
    <script src="jquery.sumoselect.min.js"></script> 
    <link href="sumoselect.css" rel="stylesheet" /> 

    <script type="text/javascript"> 
     $(document).ready(function() { 
      $(<%=lstBoxTest.ClientID%>).SumoSelect({ selectAll: true }); 
     }); 
    </script> 
    <style type="text/css"> 
     body { 
      font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 
      color: #444; 
      font-size: 13px; 
     } 

     p, div, ul, li { 
      padding: 0px; 
      margin: 0px; 
     } 
    </style> 

protected void btnGetSelectedValues_Click(object sender, EventArgs e) 
    { 
     string selectedValues = string.Empty; 
     foreach (ListItem li in lstBoxTest.Items) 
     { 
      if (li.Selected == true) 
      { 
       selectedValues += li.Text + ","; 
      } 
     } 
     Response.Write(selectedValues.ToString()); 
    } 
+0

あなたのコードを投稿してください!スタックオーバーフロー委員会のメンバーがあなたのコードを投稿することで、あなたが試したものです。 – PRABA

+0

私は完全なコードを投稿しましたコードの代わりにリンクを提供する理由を助けてくれますか?私はコードを投稿すれば両方でダウンロードできないので多くのスクリプトが必要です –

+0

jqueryプラグインが矛盾していると思いますなぜ、日付時間ピッカーとドロップダウンボックスが同時に動作していないのか。 – PRABA

答えて

0

あなたはこの実施例を試すことができますあなたが望むように、datepickerとmultiselectの両方の私は自分のローカルでテストしました

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <title>asdasd</title> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script> 
    <script src="https://www.aspsnippets.com/demos/361/Scripts/jquery.dynDateTime.min.js" type="text/javascript"></script> 
    <script src="https://www.aspsnippets.com/demos/361/Scripts/calendar-en.min.js" type="text/javascript"></script> 
    <link href="https://www.aspsnippets.com/demos/361/Styles/calendar-blue.css" rel="stylesheet" type="text/css" /> 

    <script type="text/javascript"> 
     $(document).ready(function() { 
      $("#<%=TextBox1.ClientID %>").dynDateTime({ 
       showsTime: true, 
       ifFormat: "%Y/%m/%d %H:%M", 
       daFormat: "%l;%M %p, %e %m, %Y", 
       align: "BR", 
       electric: false, 
       singleClick: false, 
       displayArea: ".siblings('.dtcDisplayArea')", 
       button: ".next()" 
      }); 
     }); 
    </script> 

    <%--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>--%> 
    <script src="http://hemantnegi.github.io/jquery.sumoselect/javascripts/jquery.sumoselect.js"></script> 
    <link href="http://hemantnegi.github.io/jquery.sumoselect/stylesheets/sumoselect.css" rel="stylesheet" /> 

    <script type="text/javascript"> 
     $(document).ready(function() { 
      $(<%=lstBoxTest.ClientID%>).SumoSelect({ selectAll: true }); 
      }); 
    </script> 
    <style type="text/css"> 
     body { 
      font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 
      color: #444; 
      font-size: 13px; 
     } 

     p, div, ul, li { 
      padding: 0px; 
      margin: 0px; 
     } 
    </style> 
</head> 
<body> 
    <form runat="server"> 
     <asp:TextBox ID="TextBox1" runat="server" ReadOnly="true"></asp:TextBox> 
     <img src="calender.png" /> 
     <br /> 
     <br /> 
     <br /> 
     <asp:ListBox runat="server" ID="lstBoxTest" SelectionMode="Multiple"> 
      <asp:ListItem Text="Red" Value="0"></asp:ListItem> 
      <asp:ListItem Text="Green" Value="1"></asp:ListItem> 
      <asp:ListItem Text="Yellow" Value="2"></asp:ListItem> 
      <asp:ListItem Text="Blue" Value="3"></asp:ListItem> 
      <asp:ListItem Text="Black" Value="4"></asp:ListItem> 
     </asp:ListBox> 

    </form> 
</body> 
</html> 
+1

働いていただきありがとうございます –

関連する問題