Possible to pass parameters from web user control client-side to server

H

Henke

How can data be passed to the server when an event is fired in client-side
jscript, ie on a drop event?
I have tried using hidden fields and submitting the page, but for some
reason I can't access a html hidden field that is set to run as server
control.
Please can someone point me in the right direction here?

/Henke
 
A

anon

Not sure if this will help...

If you have set the HTML control as hidden
via .Visible=false then .Net won't load its new value on
postback.

Try hiding the control via its style property instead and
it should be populated with the new value on postback.
 
H

Henke

Thanks for your answer, but the problem is that when I try to access the
<INPUT> that should be populated with the new value I get:
....document.forms[0].hidden is null or not an object... It seems that when I
set it run as a server object it can't be access on the client side. This
happens only if the control is used on a WebUserControl not on a WebForm.
/Henke
 
A

anon

If you just want to pass the value to the client script
take a look at

Page.RegisterHiddenField

If you need the field to be posted back too then use the
style attribute to hide the control.

D
-----Original Message-----
Thanks for your answer, but the problem is that when I try to access the
<INPUT> that should be populated with the new value I get:
....document.forms[0].hidden is null or not an object... It seems that when I
set it run as a server object it can't be access on the client side. This
happens only if the control is used on a WebUserControl not on a WebForm.
/Henke

"anon" <[email protected]> skrev i meddelandet
Not sure if this will help...

If you have set the HTML control as hidden
via .Visible=false then .Net won't load its new value on
postback.

Try hiding the control via its style property instead and
it should be populated with the new value on postback.

page,
but for some to
run as server


.
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top