473,387 Members | 1,532 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,387 software developers and data experts.

ASP.Net Controls and Javascript

I used some javascript to move entries from one ASP.Net ListBox control to
another ASP.NET Listbox control.

On the client side all appears fine, but when I click a button which causes
the page to go back to the server, the items which I placed in the ListBox
control do not show up in the ListBox.Items.Count property. Does this mean
that I can not use javascript to move values from one ASP.NET control to
another ASP.NET control? I find this hard to believe, so there must be
something I must have to do that I am not doing, but what would that be?

Any assistance would be greatly appreciated.
Nov 19 '05 #1
8 927
"Jim Heavey" <Ji*******@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
I used some javascript to move entries from one ASP.Net ListBox control to
another ASP.NET Listbox control.

On the client side all appears fine, but when I click a button which
causes
the page to go back to the server, the items which I placed in the ListBox
control do not show up in the ListBox.Items.Count property. Does this
mean
that I can not use javascript to move values from one ASP.NET control to
another ASP.NET control? I find this hard to believe, so there must be
something I must have to do that I am not doing, but what would that be?

Any assistance would be greatly appreciated.


Jim,

Client-side controls only post back their values, not their details. You can
do whatever you like with the DOM, but if it doesn't change the Value of the
control, nothing will go back to the server.

In order to do what you want, you would have to store your changes somewhere
that will get back to the server. For instance, in a hidden input field. The
server could then see the changes and add the changes to your listbox on the
server side.

John Saunders
Nov 19 '05 #2
I am adding items to an ASP.NET Control and that control goes back to the
server, so I am confused as to why my entries do not appear. The ASP.NET
control just renders to an <Select HTML object. If in my script I an
referencing this object then when that object get back to the server, those
items s/b there?

So what am I missing?
Nov 19 '05 #3
"Jim Heavey" <Ji*******@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
I am adding items to an ASP.NET Control and that control goes back to the
server, so I am confused as to why my entries do not appear. The ASP.NET
control just renders to an <Select HTML object. If in my script I an
referencing this object then when that object get back to the server,
those
items s/b there?

So what am I missing?


You're missing the fact that you are adding items to the <select> control on
the client side. HTML does not post these items back to the server. This
isn't an ASP.NET issue, it's a basic HTML issue.

The only changes you can make on the client which will be sent back to the
server are changes to the value property of the controls. That's all that's
sent back in a POST. The web browser doesn't send the entire DOM back to the
server!

John Saunders
Nov 19 '05 #4
But you can get the items in the list from the Request.Form or
Request.QueryString collection...

"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
"Jim Heavey" <Ji*******@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
I am adding items to an ASP.NET Control and that control goes back to the
server, so I am confused as to why my entries do not appear. The ASP.NET control just renders to an <Select HTML object. If in my script I an
referencing this object then when that object get back to the server,
those
items s/b there?

So what am I missing?
You're missing the fact that you are adding items to the <select> control

on the client side. HTML does not post these items back to the server. This
isn't an ASP.NET issue, it's a basic HTML issue.

The only changes you can make on the client which will be sent back to the
server are changes to the value property of the controls. That's all that's sent back in a POST. The web browser doesn't send the entire DOM back to the server!

John Saunders

Nov 19 '05 #5
"Alex Homer" <al**@stonebroom.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
But you can get the items in the list from the Request.Form or
Request.QueryString collection...
No you can't! What makes you think you can? Have you seen them? Turn on page
tracing and look to see if these are sent to the server. They're not sent!

Think about it. How much of the web page should be sent back to the server?
Whatever changed?

John Saunders
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
"Jim Heavey" <Ji*******@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
>I am adding items to an ASP.NET Control and that control goes back to
>the
> server, so I am confused as to why my entries do not appear. The ASP.NET > control just renders to an <Select HTML object. If in my script I an
> referencing this object then when that object get back to the server,
> those
> items s/b there?
>
> So what am I missing?


You're missing the fact that you are adding items to the <select> control

on
the client side. HTML does not post these items back to the server. This
isn't an ASP.NET issue, it's a basic HTML issue.

The only changes you can make on the client which will be sent back to
the
server are changes to the value property of the controls. That's all

that's
sent back in a POST. The web browser doesn't send the entire DOM back to

the
server!

John Saunders


Nov 19 '05 #6
Quick note about this simple issue,

The problem is that the person is not fully understanding the html post
item and if the item doesn’t change any value is returned to the server.

I had along time ago thought that learning Interdev 6 would solve all my
application creation issues, but after taking a expensive course in
Interdev I only discovered that, if I did not write the ASP and HTML
myself, I did not know what was going-on on the page.

This is the case here, the items must be presented and passed correctly
and only by knowing all the issues can you debug the problems quickly
and efficiently.

I do not mean to belittle anyone’s abilities, knowing these software
programs is difficult at best, just that, (to me anyway) knowing and
writing the software by hand is better that using the fancy tools of
ASP.NET.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #7
I agree, my programmers use web matrix, notepad or (preferably) an old
version of (belive it or not) Homesite

Visual Studio tricks you and you never know (or control) what is really
going on. I agree it's a fantastic tool, but sometimes if you don't want to
fit into Microsoft's Box of how navigation should work then you just have to
do it yourself.

But there is an awfull lot to learn.

Boldy

"Stibbs" <da**************@hotmail.com> wrote in message
news:ee**************@TK2MSFTNGP11.phx.gbl...
Quick note about this simple issue,

The problem is that the person is not fully understanding the html post
item and if the item doesn't change any value is returned to the server.

I had along time ago thought that learning Interdev 6 would solve all my
application creation issues, but after taking a expensive course in
Interdev I only discovered that, if I did not write the ASP and HTML
myself, I did not know what was going-on on the page.

This is the case here, the items must be presented and passed correctly
and only by knowing all the issues can you debug the problems quickly
and efficiently.

I do not mean to belittle anyone's abilities, knowing these software
programs is difficult at best, just that, (to me anyway) knowing and
writing the software by hand is better that using the fancy tools of
ASP.NET.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #8


Jim,
Am facing the same problem. can you please forward the solution if u
got it..
thank you in advance.
Antony.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #9

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

Similar topics

8
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
18
by: DartmanX | last post by:
Is there a simple way to determine if someone using Internet Explorer has completely disabled ActiveX controls? Jason
6
by: Stu Carter | last post by:
Hi, I have an aspx page where some controls are initially disabled by the code-behind 'Page_Load' event. I want these controls to be dynamically enabled when the user checks a checkbox. ...
2
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the...
5
by: Brian Kitt | last post by:
I have a C# application that builds dynamic HTML and renders it. Because it is rendered in this way, the input controls are not server controls. I write the entire page, which has a variable...
22
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said...
5
by: Dennis Fazekas | last post by:
Greetings, I am creating a web form which will all the user to add an unlimited number of email addresses. Basically I have 3 buttons, "Add Another Email", "-" to remove, and a "Save" button....
4
by: Erland | last post by:
Hello everyone, I am have couple of bad concepts and would like to clear things up. As I understand ASP.NET server controls contain runat=server tag and they only run on the server. But I've...
8
by: =?Utf-8?B?U2hhd24gUmFtaXJleg==?= | last post by:
I am coming at the world from the standpoint of a veteran ASP Classic developer. I am not clear on the advantages of using the ASP.NET control over standard HTML control. With the ASP.NET...
4
by: Lewis Holmes | last post by:
Hi I have the following situation in one of my asp.net pages. The user can add multiple table rows to a form by selecting a button. These rows can contain asp.net controls. When this button is...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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
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
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...

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.