Client-script changes not reflecing

U

Uma

hi,

I am trying to create Custom Web Control using two HtmlSelect and HtmlButton
(Add and Remove). When the user select item from left to right using Add or
Remove the page should not refresh... So, I wrote a javascript routine.
which works fine. But when I am trying to read the values of dynamically
added values from the HtmlSelect... It is not available and SelectedIndex is
set to -1. I don't understand this....

anybody please help me.

Thanks
Uma
 
A

Alessandro Zifiglio

hi Uma,
how are you reading the items from the htmlselect control ? Are you doing
this client side or are you trying to get his value on the server. I assume
on the server and you are right. This will always end up blank because you
are using the html control whereas to the dropdownlist web control. The
differences are immense one being that webcontrols maintain state via
viewstate which is saved into the page and then read again after a postback.
If you still want to use your html control then manually store the value
into viewstate, but then, why not just use a web control whereas to an html
control ;P
 
A

Alessandro Zifiglio

view state stores the value in a hidden field actually, so your still better
off using a web control ;)
 
U

Uma

Hi Alessandro,

Got it...

HtmlInputHidden and Page.Request.Form("xxx") did the trick....


thanks for trying.

Many thanks
- Uma
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top