We help IT Professionals succeed at work.

table auto update

I have a table that is programatic. I have a text box that is programtic.

Dim tb As New TextBox()
  tb1.Attributes.Add("name", "txtquantity" + cnt2.ToString())
 tb.Text = sqlDR("Quantity")

Is there a way to use keyup to update or to run in the background to have the table update when a user enters a number in the text box without the page posting back on the front end or having the page to smoothly update. without the user noticing.

 <asp:table id="newItem"  EnableViewState="true" HorizontalAlign="Center"   Visible="true"
            runat="server" Height="10px" CellSpacing="1" CellPadding="1" Width="970px">            
Comment
Watch Question

Sure. First, you would place the table you want to refresh in an UpdatePanel, and write a client script that calls a client-side postback (replace UpdatePanel1 with the ID of the UpdatePanel control):

function keyUpHandler() {
    __doPostBack('UpdatePanel1', '');
}

This can be written into your ASPX, or you can attach it server-side using the ScriptManager.

Then, you just bind that method to the keyup event on your TextBox:

Dim tb As New TextBox()
tb1.Attributes.Add("name", "txtquantity" + cnt2.ToString())
tb1.Attributes.Add("onkeyup", "keyUpHandler();")

Similar ends can be achieved using jQuery, or whatever your preferred JavaScript library is.
Seven priceFull Stack

Author

Commented:
tks