S
sonic
I came across a problem today that seems very trivial however i did not
yet solve it elegantly.
Normally, when i need to pass values between server and javascript, I
create a server control such as textbox or htmlInputHidden and
update/read it on both sides.
However, I am developing a user control, which does not have a UI
component, and so I cannot just drop a TextBox on the page and declare
it as protected inside of my control and access it. ( I am aware that I
can add a UI component such as ASCX file but I am not doing it in this
example )
The only thing I can do it seems is override Render event, and render
any elements i would like to appear on the browser. However I have not
yet figured out how to read those controls back on post back, since
they need to be re-created every time.
What is the most elegant solution in this example to pass variables
from javascript back to the server ?
TIA
yet solve it elegantly.
Normally, when i need to pass values between server and javascript, I
create a server control such as textbox or htmlInputHidden and
update/read it on both sides.
However, I am developing a user control, which does not have a UI
component, and so I cannot just drop a TextBox on the page and declare
it as protected inside of my control and access it. ( I am aware that I
can add a UI component such as ASCX file but I am not doing it in this
example )
The only thing I can do it seems is override Render event, and render
any elements i would like to appear on the browser. However I have not
yet figured out how to read those controls back on post back, since
they need to be re-created every time.
What is the most elegant solution in this example to pass variables
from javascript back to the server ?
TIA