ASP.NETを使用して、リピーターを使用してDBテーブルを画面に表示します。
ユーザーがチェックボックス(テーブル内のフィールド)をチェックまたはチェック解除できるようにしたい。Management Studio の DB 内の対応するフィールドをリアルタイムで更新します.....
グーグルで調べています。JQueryはその方法のようです....これまでのところ私は持っています...
コードビハインド:
//GetUtilityCompanyNames() returns a list of all the companies names
rptSelectedUtilities.DataSource = GetUtilityCompanyNames();
rptSelectedUtilities.DataBind();
aspx:
<asp:Repeater id="rptSelectedUtilities" runat="server" DataSourceID="rptSelectedUtilities">
<HeaderTemplate>
<table class="detailstable FadeOutOnEdit">
<tr>
<th style="width:200px;">Utility</th>
<th style="width:200px;">Contacted</th>
<th style="width:200px;">Comment</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<th style="width:200px;"><%# Eval("Name") %></th>
<th style="width:200px;"><asp:CheckBox ID="chkMyCheck" runat="server" Checked='<%# Convert.ToBoolean(Eval("Checked")) %>'/></th>
<th style="width:200px;"><%# Eval("Comment") %></th>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<asp:Label id="labelTableEmpty" runat="server" Text="There are currently no items in this table." />
<script type="text/javascript">
$('bla').
//ここから始める方法がわからない??
リピーターの DataSourceID を =="rptSelectedUtilities" に設定したので、スクリプトに追加する必要がありますが、私は初心者なので、助けていただければ幸いです。
ありがとう