Refreshing a Web Listbox

StevenC

Member
Joined
Jul 15, 2007
Messages
13
Programming Experience
5-10
Is there anyway to refresh the data in a web listbox without the whole page reloading?
 
Try to find some information about what they call "AJAX". It's about using client-side asynchronous Javascript calls to make server requests and update content without page postback.
 
Try to find some information about what they call "AJAX". It's about using client-side asynchronous Javascript calls to make server requests and update content without page postback.

Thank you for the reply John. I did download and install AJAX. It seemed to do the same thing. Everytime I changed data in my bound listbox and tried a refresh it looked like it reloaded the whole page. Since I will be changing the data quite often it seems like this would be hard on the users eyes after awhile. It is possible I was not doing something right. I was following a sample I found on the AJAX web site. Everything worked good except for this problem.
 
When you say you installed "AJAX" you probably mean the Microsoft AJAX controls. I don't know too much about these yet, perhaps they have ready functionality for what you do. I actually meant both this "framework", and AJAX as a general term, which existed long before MS released this, and the general combination of technologies used was also used long before some decided to call it just that. Just in case you don't find the class or control in MS AJAX doesn't mean it can't be done, but you might have to learn Javascript programming and write the script to do what you want in that case. People have been doing this kind of thing with client-side scripting in plain Html web pages for ages.
 
Refreshing Web Listbox

Thanks JohnH. I sort of figured I was trying to reinvent the wheel here. I ask this same question somewhere else and they told me it was impossible. Usually when someone tells me that it makes me want to do it all the more. I have always tried to stay away from writing programs for the web so I am new to this. I thought MS AJAX was something new. I will take your advice and do some more learning on AJAX and Java. Thank you for taking the time to answer my question.
 
It would be better if the simplified MS AJAX framework had something you could use of course, but I don't know. UpdatePanel looks promising. And btw Javascript have nothing to do with Java, they are different programming languages.
 
Thanks for the info.

It would be better if the simplified MS AJAX framework had something you could use of course, but I don't know. UpdatePanel looks promising. And btw Javascript have nothing to do with Java, they are different programming languages.

JohnH, thank you for including the UpdatePanel link in your reply. I read that page and the more I think about it, it seems like I had my button to trigger the refresh located outside of the UpdatePanel. I'll bet that is my problem. I am going to move it inside and see what happens. I will let you know how it works out.
 
Moving the button into the UpdatePanel is one option, another is to add it to the UpdatePanels Triggers list for async postback.

When trying this first I just added the panel to a new page in an existing project, the page appeared otherwise to be working, but with full postbacks either way. I noticed IE displayed the JS error icon and turned on script error messages, so there was a "Sys is undefined" error. Solution was to start a new "ASP.NET AJAX-Enabled Web Site" project, the AJAX-framework need some stuff in the Web.Config to work.
 
I've been using ASP.NET AJAX since it was in Beta & named Atlas. It is possible to do what you're asking. Placing the button in the UpdatePanel should solve your problem.

Currently, the first video on the AJAX.ASP.NET site shows an example for a To Do list and should give you some insight.
 
Moving the button into the UpdatePanel is one option, another is to add it to the UpdatePanels Triggers list for async postback.

When trying this first I just added the panel to a new page in an existing project, the page appeared otherwise to be working, but with full postbacks either way. I noticed IE displayed the JS error icon and turned on script error messages, so there was a "Sys is undefined" error. Solution was to start a new "ASP.NET AJAX-Enabled Web Site" project, the AJAX-framework need some stuff in the Web.Config to work.

Ok...I tried this same thing. (the ASP.NET AJAX-Enabled Web Site) and everything worked good. I then created a folder under my existing web site (not an AJAX-Enabled Web Site) root and moved my sample into that folder, including the web.config file. I linked to the sample page from my main page and the whole page started loading again instead of just refreshing the listbox. I thought by moving the web.config file into that folder it would take care of anything I might have been overlooking when Visual Studio created the AJAX-Enabled Web Site. I have a bad feeling I am going to have to redo my whole existing web site and start by making it an AJAX-Enabled web site. I was trying to avoid that since there are so many pages in it.
 
Here is what I did

Moving the button into the UpdatePanel is one option, another is to add it to the UpdatePanels Triggers list for async postback.

When trying this first I just added the panel to a new page in an existing project, the page appeared otherwise to be working, but with full postbacks either way. I noticed IE displayed the JS error icon and turned on script error messages, so there was a "Sys is undefined" error. Solution was to start a new "ASP.NET AJAX-Enabled Web Site" project, the AJAX-framework need some stuff in the Web.Config to work.

Ok...I tried this same thing. (the ASP.NET AJAX-Enabled Web Site) and everything worked good. I then created a folder under my existing web site (not an AJAX-Enabled Web Site) root and moved my sample into that folder, including the web.config file. I linked to the sample page from my main page and the whole page started loading again instead of just refreshing the listbox. I thought by moving the web.config file into that folder it would take care of anything I might have been overlooking when Visual Studio created the AJAX-Enabled Web Site. I have a bad feeling I am going to have to redo my whole existing web site and start by making it an AJAX-Enabled web site. I was trying to avoid that since there are so many pages in it.
 
Links

I've been using ASP.NET AJAX since it was in Beta & named Atlas. It is possible to do what you're asking. Placing the button in the UpdatePanel should solve your problem.

Currently, the first video on the AJAX.ASP.NET site shows an example for a To Do list and should give you some insight.

Thank you Paszt for the links. I will check these out also.
 
the AJAX-framework need some stuff in the Web.Config to work.
It also have a reference to System.Web.Extensions I see now, it's in the .Net assemblies list of the Add Reference dialog.
 
Do you think I would need to add the one that says System.Web.Extensions.Design also?
It is not referenced in my "ASP.NET AJAX-Enabled Web Site" project.
 
Back
Top