473,503 Members | 8,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript and code behind

Hello All!

I'm trying to wrestle with what seems to me to be a simple concept but
has been frustrating trying to implement. I have asp.net page with 2
listbox controls. The first is populated on page load. I'm using
javascript to select items from the first and enter into the second -
I do this to avoid postback. The problem is in the code behind, the
second listbox does not contain any of the items that I had inserted.
I view the html page source and the second listbox is empty but the
html page clearly displays items! Please help shed some light on
this. Thanks!

Feb 9 '07 #1
1 1018
"oxwood" <ox******@gmail.comwrote in message
news:11**********************@m58g2000cwm.googlegr oups.com...
Please help shed some light on this.
Standard behaviour, I'm afraid...

Just before you do the postback, you need to copy the contents of the
listbox into a hidden field, which will then persist across postback.

Loads of examples:
http://www.google.co.uk/search?sourc...cript+postback
Feb 9 '07 #2

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

Similar topics

136
9201
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
3
8632
by: Nevyn Twyll | last post by:
I've got a web form with a number of dropdowns, combos, etc. When the user submits the form, I want to redirect them to another form, but I need to pop it in another window. So, I have a hyperlink...
5
14731
by: Vinod Kumar | last post by:
Hi All, Can I access a Javascript function written in an ASP.NET from the codebehind (C#) of that page? If yes, kindly give the code snippet to do this. Thanks and Regards Vinod Kumar
4
1973
by: Nevyn Twyll | last post by:
I have a web form, with c# code-behind. I have a listbox on the form, bound to a dataset. I want to have 2 buttons/hyperlinks/etc. beside the listbox. When they are clicked, I want to launch a...
1
9118
by: Machi | last post by:
let say i have a web form with a button on it ... when i click the button, it will pop up one small window to allow me to save a pdf file, everything is done using code behind as below ... however,...
6
4491
by: Jim | last post by:
Group, How would I go about firing a JavaScript method from a C# method in the aspx code behind file? It seems as though this could not be done since JavaScript is executed from within the Web...
3
1898
by: Opa | last post by:
Hi, I'm new to ASP.NET and I am not sure if I should start using the code behind paradigm or if I should just go with traditional HTML, CSS, and JavaScript. Although Code Behind seems nice, the...
3
1255
by: UJ | last post by:
I have a JavaScript that fills in a text box with a date/time. I then need to access it my code behind code. If I make the input field runat=server, I can get at it by code behind but JavaScript...
8
2594
by: Frank | last post by:
Hi, I am working with VS.NET 2005 Ultimately, I wish to call a JavaScript function from a .js file
5
1981
by: mesut | last post by:
Hi there, how are you colleagues? I try to set a linkaddress in code behind for a <asp:hyperlinkserver control. but I think I have some syntax problem. I don't know how to fix it. What's...
0
7194
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
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7267
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
7316
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
4993
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
4666
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
3160
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...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
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.