I haven't started writing any code for this program, but here's what I need to do in C#/ASP.NET, both of which I'm just starting to learn.
I have a DIV on a page that I want to update with information from an MS SQL Server every five seconds.
Would it be better to create my countdown timer on the JavaScript or C# side?
Would UpdatePanel or creating a Page Method be more efficient for updating the DIV with the database information?
Load times are a serious issue for this application, so the lighter and faster the solution, the better.
1) You'll have to create the countdown timer on the client in javascript since the client is disconnected from your server-side code except when it explicitly sends requests to it.
2) UpdatePanel
will be less efficient, because it posts all of your page's form values (including any ViewState
or EventValidation
material), when all you might need to pass to the server is a few bytes (for an id, for example). However, this difference in efficiency may not be significant if your query times are high (or the cost of transporting/rendering the data is high).