473,503 Members | 12,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Items added to list box with client side script not present on postback

In an ASP.NET web application, I am using the standard list box server control and I am adding items to with client side script. When the page posts back, the added items are not available on the server.

What do I have to do to make the items available on the server after a post back

Jul 21 '05 #1
2 2159
I guess that would make sense if you think about it. Once the page is
rendered, there is no communication back to the server.

You either have to deal with the post back each time or be a bit more
creative.

How about sending a quick note to the server from javascript to fill a
database on the server side... Maybe someone else has a method of getting
the contents of the drop down on the server and then re-writing it.

My method is a bit messy, but makes for a clean user interface.... I keep
the data for the drop down in a database on the server and update the server
each time I update the drop down on the client side..

s_xml stores a small xml dataset for the one item that is added

var xml_http = new ActiveXObject("Microsoft.XMLHTTP");

var xmlSend_doc = new ActiveXObject("Microsoft.XMLDOM")
xmlSend_doc.async = false;

xmlBack_doc.async = false;
xmlSend_doc.loadXML(s_xml)

"Bill Manring" <bi**********@wavefrontsoftware.com> wrote in message
news:FF**********************************@microsof t.com...
In an ASP.NET web application, I am using the standard list box server control and I am adding items to with client side script. When the page
posts back, the added items are not available on the server.
What do I have to do to make the items available on the server after a post back?

Jul 21 '05 #2
I guess that would make sense if you think about it. Once the page is
rendered, there is no communication back to the server.

You either have to deal with the post back each time or be a bit more
creative.

How about sending a quick note to the server from javascript to fill a
database on the server side... Maybe someone else has a method of getting
the contents of the drop down on the server and then re-writing it.

My method is a bit messy, but makes for a clean user interface.... I keep
the data for the drop down in a database on the server and update the server
each time I update the drop down on the client side..

s_xml stores a small xml dataset for the one item that is added

var xml_http = new ActiveXObject("Microsoft.XMLHTTP");

var xmlSend_doc = new ActiveXObject("Microsoft.XMLDOM")
xmlSend_doc.async = false;

xmlBack_doc.async = false;
xmlSend_doc.loadXML(s_xml)

"Bill Manring" <bi**********@wavefrontsoftware.com> wrote in message
news:FF**********************************@microsof t.com...
In an ASP.NET web application, I am using the standard list box server control and I am adding items to with client side script. When the page
posts back, the added items are not available on the server.
What do I have to do to make the items available on the server after a post back?

Jul 21 '05 #3

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

Similar topics

5
11429
by: Kay | last post by:
Hello, I have two list boxes on my form, one initially displays with items and the other displays blank, by clicking a button, it is possible to move items from one box to another and vice a...
6
6493
by: Valerian John | last post by:
I have a ListBox webcontrol on an aspx page. Items are added to the ListBox using client-side code. However, when the page is posted back the items are missing/not available. (It is like the...
5
2444
by: Brian Henry | last post by:
I am trying to add some items to a list box in java script, they add just fine, the values and text are how they should be. The problem though is when I try to access these added items from asp.net...
3
6090
by: Stimp | last post by:
I have a listbox of values that I populate from a database. I want the user to be able to re-order the list (by first selecting an item and then clicking 'up' or 'down' buttons) and then save...
2
343
by: Bill Manring | last post by:
In an ASP.NET web application, I am using the standard list box server control and I am adding items to with client side script. When the page posts back, the added items are not available on the...
2
6238
by: Bart Van Hemelen | last post by:
The situation: I have a CheckBoxList cblTest, the items are disabled in cblTest_DataBound in a foreach (ListItem oItem in cblTest.Items) loop. I provide a link that calls a client-side JavaScript...
3
9969
by: Brian Simmons | last post by:
Hi All, I search on codeproject and google but didn't find what I was looking for. Anybody know of a good implementation where you have 2 listboxes and you want to move items between the 2. ...
4
4623
by: bogdan | last post by:
Hi, I have two listboxes on a page and need to move items between them - using buttons (e.g. "<<" ">>"). Can this be done on a client side in asp.net? I'd like to avoid hitting the server on...
7
1766
by: yanni | last post by:
I have some thing like this: <body> <form id="form1" runat="server"> <div> <asp:DropDownList ID="uxTestDropDownList" runat="server" /> <asp:Button ID="uxSubmitButton" runat="server"...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.