I have an ASP.NET web app I’m developing but I have a question concerning efficiency. On my page I have Textboxes that have an OnTextChange event that calls a C# page with the function inside. The function works and sums up some values and sends the output back to the page. Now the function is only called if some event triggers a Postback to the server then the calculations are done. I’m wondering if I use both server-side code and some Javascript to do the same calculations would there be a conflict in data when the Postback occurs? For example If I’m submitting the data to a SQL database would there be any sort of issue? Javascript is immediate at doing simple math and would be a better UI for the user to have instant results when punching in some numbers to the textbox, without having to press enter or a submit button.
Share
You shouldn’t worry about this. Whatever you do in Javascript will post back correctly to the server. You will not see any kind of “conflicts”.