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?
 
This is what I have

It is not referenced in my "ASP.NET AJAX-Enabled Web Site" project.

Ok John, here is something that might help. Sorry I never noticed this before. Everything works good when I move it into my existing web site but it still loads the whole page. On the default.aspx page (this is the page where I am trying to refresh the listbox) it has red lines under the asp:ScriptManager and asp:UpdatePanel. When I put my mouse pointer over that it tells me this "ScriptManager is not a known element. This can occur if there is a compilation error in the web site." Does that help you any? How would I fix that?
 
Last Error

Ok...I got rid of the last error I told you about (the red lines) by adding another ScriptManager Control to the page and then deleting it. Now that is ok. Still loading the whole page though. Before I drive you crazy I suppose I better try starting fresh with an AJAX-Enabled web site and then move all of my existing files into that.
 
In my case to enable AJAX for existing site it was only a matter of adding the correct sections to web.config, I retrieved those from the fresh AJAX-enabled template, copied them all over to not interfere with any current site settings. Adding the reference was redundant because it was already included in the web.config compilation-assemblies section.

I also found this: http://ajax.asp.net/docs/ConfiguringASPNETAJAX.aspx (Adding ASP.NET AJAX Configuration Elements to an Existing Web Site)

You might have to rebuild/close/restart VS, at least that is something I often have to do with VWD when it's getting "squiggly". (not complaining, I probably mess with it the wrong way)
 
Refreshing Web Listbox

Thank you JohnH. I will do what you suggested and copy the settings over from a newly created AJAX-enabled web site. If I am not mistaken it looks like you can have a web.config file for each folder. Should I copy the AJAX settings into the web.config in my main root folder or only the web.config file in the folder where I am running AJAX related controls?

Also, thank you for the learning video link. I just downloaded it and will watch it now.
 
It's not a video link, just description of the configuration elements.
 
Finally

It's not a video link, just description of the configuration elements.

Ok sorry on the video link. When I clicked on it, it took me to a page where you could watch a video or download it so I downloaded it thinking it was some type of video to watch. I also downloaded the VB Source or example file on that same page.

Anyway, I did like you told me and created the AJAX-enabled web site and copied the settings from that to my existing web site and now everything is working good. I was getting a little worried because when I pasted the new settings into my original web.config file it kept giving me errors and I had to keep deleting old settings until there were no more errors. It seemed like I cut out quite a bit of settings from my original file but I tested and everything on my orginal web works good along with the AJAX stuff.

Thank you for having patience and helping me. I appreciate it very much.
 
If I am not mistaken it looks like you can have a web.config file for each folder. Should I copy the AJAX settings into the web.config in my main root folder or only the web.config file in the folder where I am running AJAX related controls?
You can have multiple web.config files for the application, they apply from child folder downwards if not overridden, and you only need the AJAX configs for those pages that use it.
 
web.config

You can have multiple web.config files for the application, they apply from child folder downwards if not overridden, and you only need the AJAX configs for those pages that use it.


Ok...before I was putting those AJAX settings in the web.config file that was located in the sub-folder where I was trying to do the AJAX stuff. When I placed them in the web.config file in the root directory thats when everything started working. I'll bet something was overriding the settings before just like you suggested.
 
Back
Top