1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

update in realtime using - jQuery

Discussion in 'jQuery' started by xna4life, Mar 8, 2013.

  1. #1
    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:Repeaterid="rptSelectedUtilities"runat="server"DataSourceID="rptSelectedUtilities"><HeaderTemplate><tableclass="detailstable FadeOutOnEdit"><tr><thstyle="width:200px;">Utility</th><thstyle="width:200px;">Contacted</th><thstyle="width:200px;">Comment</th></tr></HeaderTemplate><ItemTemplate><tr><thstyle="width:200px;"><%# Eval("Name") %></th><thstyle="width:200px;"><asp:CheckBox ID="chkMyCheck" runat="server" Checked='<%# Convert.ToBoolean(Eval("Checked")) %>'/></th><thstyle="width:200px;"><%# Eval("Comment") %></th></tr></ItemTemplate><FooterTemplate></table></FooterTemplate></asp:Repeater><asp:Labelid="labelTableEmpty"runat="server"Text="There are currently no items in this table."/><scripttype="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
     
    xna4life, Mar 8, 2013 IP
  2. Milosovic Bejdak

    Milosovic Bejdak Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Please format your code.

    First of all, please provide some information about what you are trying to accomplish. You mentioned that you wanted to update the checkboxes in real time. The problem is, real-time can only be done through sockets. By using AJAX, you are actually referring to polling. You are going to have to setup a setInterval every x amount of seconds that will fire an ajax and check the database for changes.
     
    Milosovic Bejdak, Mar 9, 2014 IP