Showing posts with label curious. Show all posts
Showing posts with label curious. Show all posts

Monday, March 26, 2012

ListBox Question For ajax guru....

ok, I may be pushing the limits of whats possible with the ajax listbox, but I'm curious...

Is it possible to populate one listbox with the SELECTED contents of another listbox. ie I have a list box of many subjects the user can select, I want all the subjects the use selects to populate the 2nd listbox, then in the 2nd listbox the user can select a primary subject.

The roadblock I see with this is that that the asp:listbox control doesn't have an onclientclick property,

this could be easily achieved a server side function that chose the selected index from listbox1 and added and item to listbox2 (using ajax).

refer my article.

i have used dropdownboxes for this.

http://www.codeproject.com/Ajax/dropdown_box_using_ajax.asp


Thanks for the quick reply. I was actually curious if there was a way to do this with ASP AJAX rather than a full blown Javascript implementation.


bbaxter:

The roadblock I see with this is that that the asp:listbox control doesn't have an onclientclick property,

I guess you already have an idea about how to achieve what you need if this property is available. As far as I know, you can use onchange event for the list to get a similar function.

To add it, you may use the following code: ListBox1.Attributes.Add("onchange", "a function");

Hope this helps.

Saturday, March 24, 2012

ListView vs. UpdatePanel with GridView

I am curious - which is the 'better' approach?

It appears with the listview and itemview you can accomplish much of what the gridview does.

Is there a performance difference?

On a side note - I hope to get some designer support for the listview/itemview/navigation/sorting - something similiar to the listview where you can create item templates - specify data columns from the datasource, etc...

hello.

i guess you'll just have to measure it :) i guess that using a gridview will be easier but you should take into account that when the contents of a panel are refreshed, everything is sent back to the server (this might be the sabe thing as doing a complete postback!)...