Retrieve valus modifed using AJAX

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a drop-down list, where by on change the value is sent to the server
(using AJAX), and a label is in turn updated on the form with the result.
This is working well, however, when I hit submit and do a traditional
post-back, the value for the label is "".

Is there something that I have to set on the label to be able to retrieve
the value on post-back?
 
labels are not posted back, so there is no way for the server to know it
changed. your client script could use a hidden field to tell the server it
changed the label.

-- bruce (sqlwork.com)
 
Hello Ryan,

I agree with Bruce on this. When you use client-side script to change the
Label control(actually its client-side html element)'s text, this change
does not affect the Label control's server-side state(which by default
persisted in page's ViewState area). Fortunately, since ViewState data is
serialized binary data which is not human readable, it's impossible to use
client-side script to directly modfiy it. Therefore, I also suggest you
consider Bruce's suggestion about using a hidden field to persist any
changes made on the client-side which also need to be persisted in those
certain controls' server-side state after postback.

If you have any other ideas or questions, please feel free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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

Back
Top