John
John

Reputation: 3945

update in realtime using - jQuery

using ASP.NET I use a repeater to displaying a DB table on screen.

I want the user to be able to check or uncheck a tick box(field in the table). Updating the corresponding field in the DB in Management Studio on real time.....

Looking through google. JQuery seems the way....so far I have got...

in code behind:

//GetUtilityCompanyNames() returns a list of all the companies names
 rptSelectedUtilities.DataSource = GetUtilityCompanyNames();
 rptSelectedUtilities.DataBind();

In 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').             

//dont kno how to start here??

I've set the DataSourceID on the repeater to="rptSelectedUtilities", then i need to add in the Script but I am a beginner at this and would appreciate any help please.

Thanks

Upvotes: 1

Views: 1136

Answers (1)

colemande
colemande

Reputation: 392

If you are really needing this to be realtime I would suggest looking at signalr. It might be a lot to bite off this early in your learning stage but I am currently switching out all of my ajax calls to use signalr instead.

Upvotes: 1

Related Questions