Click here to Skip to main content
15,919,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I have a question that in my web page(developed on Asp.Net and C# code using Visual Studio 2010 4.0 Frame Work).
In a page i have 3 textboxes
Textbox1 is From date
Textbox2 is To date
Textbox3 is Variance(Number of working days from "From date"(Textbox1) to "To date"(Textbox2))
And i am getting the result as per the calculation which i written in textbox2 event(when user selected Todate then it will calculate and displays the correct result)
So here the issue was when it was calculating because of AutoPostBack="true" whole page was refreshing and displaying the result and page was going top of the page it was not staying or highlighting to the next control and i dint used any ajax controls too when i am not using autopostback as true then the result was not getting calculated and not displaying the result as well.

Please help me to avoid this page refresh and top of the page issue.

Thanks in Advance
Venu
Posted
Updated 21-Jan-16 1:57am
v2

Wrap your controls in an asp:UpdatePanel so that the update happens via ajax.
 
Share this answer
 
If you want the variance field to be calculated on the server, you could surround those text boxes with an update panel. Update panels let you do partial page post backs so only the controls inside it will be updated.

You'll get more performance however by doing you calculation client side with JavaScript.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900