Reputation: 49251
I have an ASP.NET page that is interacting with a business class. I want to continuously update controls on my page based on user entered values, e.g. update totals. The calculations are embedded in business logic but they're simple enough to reproduce elsewhere. I've thought of three ways to accomplish this:
The third method seems cleanest to me, provides a nice user experience, and allows me to interact directly with my business class that I've stored in session state.
My question is: Is this a good idea and/or a common practice? Are there better ways to accomplish this?
I haven't done ASP.NET work for a few years and I have a prejudice against autopostback[1]. I've looked at the size of the request and it's currently negligible at 1.5kB. The site will be low use but we may have a small number of users with dial-up connections.
Upvotes: 0
Views: 1132
Reputation: 245399
You're correct in thinking the third option is your best. This is the kind of thing that AJAX is made for. Go for it.
Upvotes: 0
Reputation: 421978
Personally, I think UpdatePanel
is too heavy. You could use jQuery along with an ASP.NET Web service function that outputs JSON.
Upvotes: 5