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

  • Thread starter Thread starter Henke
  • Start date Start date
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
 
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.
 
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
 
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


.
 
Back
Top