Client Side changes not refecting server side label

G

Guest

I have a server side label and text box
From the client side I am changing the value of the ASP.NET labe
using the innerText property of the label.
When I try to access the label from the server side I am getting the old valu
of the label which was initially populated before calling the java script function .
Can anyone tell me what is going wrong

Regards
Srini
 
R

Rajiv R

Hi Srini

If you understand how data is sent to the server when you submit is form on
a page, you will realise that the form elements (<input>,<select>) is sent
as a querystring or as name-value pairs.

labels are not form elements and this is not send/postedback to the server.

what you may do is have a hidden form element and update it with the same
value as u set ur label to and access the hidden form element in your
server.

hope that helps
 
R

Rajiv R

Hi Ajax,

Could you elaborate?

--
Cheers!
Rajiv. R
Rajspace.Org

Ajax said:
I'm agree with the hidden control solution for the label problem but I
still have the same problem with the select.
 
G

Guest

Sorry,
I have 2 listbox server controls in my page and I want to interchange items between them. One solution could be make the interchange in the server, another could be make it in the client. When I tried to achieved client solution I made the changes in "select" that result from the "listbox" on the server, and when a post was made it I got the original listbox without any of changes I made

Thanks for your attention.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top