Click to See Complete Forum and Search --> : Control Persistence
ReCoiL
July 4th, 2008, 01:52 PM
Right now, my site has a navigation bar on the left. When I click a link, I wish to load an aspx user control to the right side of the page. When I do a server refresh by clicking a button, the control goes away, of course.
Can I use AJAX to only refresh the data in the control without affecting the rest of it? I've tried to implement it. If you click the button the first time, it won't be refreshed, but it seems to have no effect. If you click a second time, it reloads the page
ReCoiL
July 4th, 2008, 02:03 PM
Sorry, just to clarify, the sequences goes:
1) Click a navigation button (Just a ul with button handlers)
2) Control loads on right side of page with input forms
3) User clicks a button on the control
4) Control disappears
I can work around this by ensuring that the control reloads every time there's a server refresh and using an integer variable to keep track of which control to load. but I figured using AJAX would be much more elegant
Alsvha
July 5th, 2008, 03:30 AM
You can use AJAX (asp.net ajax) to solve this, yes.
I don't have an IDE installed at this computer right now so I can't supply code right now, but I'm sure somebody else will :)
But yes, you can do that by using the asp.net ajax update panels, and a script manager etc. from the asp.net ajax extensions, and it should be pretty simple.
Otherwise - you can on of course load in the full control tree as you mention, but asp.net ajax (or ajax in general) can make for more "responsive" and slick pages.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.