ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help , on Server client listbox update

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming
View previous topic :: View next topic  
Author Message
EranS



Joined: 25 Jan 2006
Posts: 1

PostPosted: Wed Jan 25, 2006 6:57 am    Post subject: Help , on Server client listbox update Reply with quote

Hi all,

I’m very new here and I hope you can help me.

I’m using ASP.NET and I have a list box.

On page load (in the "code behind") I’m adding the value "Dani" to the list box.
==================================================
If Not Page.IsPostBack Then
ListBoxPoints.Items.Add("Dani")
End If
==================================================

Then in the client-side I’m adding the value "Ben" to the list box

==================================================
var Points_ = document.getElementById("ListBoxPoints");
var myOption = document.createElement("OPTION");
myOption.text = "Ben";
myOption.value = "Ben";
Points_.add(myOption);
==================================================

Up to here, all is good.
Now, when I click Submit and go to the server, I can’t see "Ben" in there like it wasn't added to the list box.

What am I doing wrong?
Any help will be highly appreciated.
Thanks Eran
Sad Sad
_________________
ASP.NET
JavaScript
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Wed Jan 25, 2006 10:07 pm    Post subject: Reply with quote

The client-side one is added after the page has been executed on the server. When you reload the page the server-side code doesn't have the 'Ben' entry yet.



Peter
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial