473,383 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

AJAX TabContainer - losing ListBox data on postback

Mel
On a tab I have one DropDownList which requires a postback and two
ListBoxes which do not require any postback because I just have some
javascript, defined in the aspx file, to copy items from one listbox
to the other. All 3 of these controls exist in a table which is
inside an UpdatePanel. When the drop down list value changes and the
postback occurs the data that I had in my listbox control disappears.
How do I fix this?

(using: asp.net 2.0, vb.net, visual studio 2005, winxp pro sp2)
Oct 23 '08 #1
3 6373
the browser only sends back the selected value to the server. if
javascript adds a new value, when the postback is processed on the
server, the server side DropDownList has no matching item to select.

in oninit you need to add code on the server side that adds the new
value to the DropDownList. you could look in the form collection for the
value.

-- bruce (sqlwork.com)

Mel wrote:
On a tab I have one DropDownList which requires a postback and two
ListBoxes which do not require any postback because I just have some
javascript, defined in the aspx file, to copy items from one listbox
to the other. All 3 of these controls exist in a table which is
inside an UpdatePanel. When the drop down list value changes and the
postback occurs the data that I had in my listbox control disappears.
How do I fix this?

(using: asp.net 2.0, vb.net, visual studio 2005, winxp pro sp2)
Oct 23 '08 #2
Mel
On Oct 23, 8:30*am, bruce barker <nos...@nospam.comwrote:
the browser only sends back the selected value to the server. if
javascript adds a new value, when the postback is processed on the
server, the server side DropDownList has no matching item to select.

in oninit you need to add code on the server side that adds the new
value to the DropDownList. you could look in the form collection for the
value.

-- bruce (sqlwork.com)

Mel wrote:
On a tab I have one DropDownList which requires a postback and two
ListBoxes which do not require any postback because I just have some
javascript, defined in the aspx file, to copy items from one listbox
to the other. *All 3 of these controls exist in a table which is
inside an UpdatePanel. *When the drop down list value changes and the
postback occurs the data that I had in my listbox control disappears.
How do I fix this?
(using: asp.net 2.0, vb.net, visual studio 2005, winxp pro sp2)
I don't understand what you mean...
Oct 23 '08 #3
Mel
On Oct 23, 10:22*am, Mel <MLights...@gmail.comwrote:
On Oct 23, 8:30*am, bruce barker <nos...@nospam.comwrote:
the browser only sends back the selected value to the server. if
javascript adds a new value, when the postback is processed on the
server, the server side DropDownList has no matching item to select.
in oninit you need to add code on the server side that adds the new
value to the DropDownList. you could look in the form collection for the
value.
-- bruce (sqlwork.com)
Mel wrote:
On a tab I have one DropDownList which requires a postback and two
ListBoxes which do not require any postback because I just have some
javascript, defined in the aspx file, to copy items from one listbox
to the other. *All 3 of these controls exist in a table which is
inside an UpdatePanel. *When the drop down list value changes and the
postback occurs the data that I had in my listbox control disappears.
How do I fix this?
(using: asp.net 2.0, vb.net, visual studio 2005, winxp pro sp2)

I don't understand what you mean...
I figured it out. When I copy, move position, or delete an item from
the listbox I call a Get_Item_List function in Javascript to store all
of the items to a hidden field. Then on page_load of the form if the
hidden field has a value I update the list box with the items I have
stored in the hidden field.
Oct 23 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ma | last post by:
Hello, I installed the latest version of AJAX toolkit today and start playing with it. I can not add any AJAX control to my page. When I try to add it, it is added as follow: ...
7
by: MikeB | last post by:
Hello All, I am new to ajax and wanted to start by trying something simple. I have a web form with an updatepanel and then inside the update panel I have a listbox. Then outside of the updatepanel...
0
by: mimifara | last post by:
Good Morning, I have a problem with my listbox control, and i tried everything i found on the web but maybe i'm still missing something. I have a listbox that i control with a datatable <the data...
1
by: =?Utf-8?B?TW9oc2luIEtoYW4=?= | last post by:
Hi, I am working on a website where i am creating Horizontal Menus Dynamically from database as per rights available to the user. I have several UserControls. And the Menu control also brings...
2
by: =?Utf-8?B?Q29sb3JzdG9uZQ==?= | last post by:
Hi, I have a TabContainer inside a data bound FormView (to logically group the form fields into different tabs). The display part of the data binding works fine, but the Update doesn't. ...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
0
by: Mel | last post by:
On Oct 23, 8:30 am, bruce barker <nos...@nospam.comwrote: Huh? Did you mean Listbox not DropDownList? The drop-down is working fine, it's the Listbox data that gets cleared after the drop-down...
1
by: E11esar | last post by:
Hi there. I have created an asp.net page with C# and have added two tabs using the respective AJAX control. I am trying to add a table within an AJAX Accordion control in the second tab but I am...
5
by: temijojo | last post by:
Hello, Can someone help me in this problem. In my content page, I used 2 user controls inside an Ajax Toolkit TabControl. One of the user controls is a data entry with a dropdownlist. The...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.