Easy question (i hope)

D

dave

I have built a custom control with a hidden html input box. I use this
hidden field to hold a value that i wanted posted back to the server after
the click event of a page button.
Within this event, i am able to access the hidden field value through a
property in my custom control. That seems to work ok.

The problem however, is that the value of this hidden field is not available
during the CreateChildControls of the custom control. As a result after the
postback i am not able to store or use the posted value in the control while
it renders after the postback. I have been pulling my hair out on this. It
seems that it is a timing issue the control renders prior to the value being
available.

Where/how can i get the value of this hidden field prior to the control
running CreateChildControls?

any ideas?



while loading the control after the postback i need this value inside the
custom control. It seems that the control is render and executes
CreateChildControls prior to the posted value (in the hidden field) is
availble to the control.
 
S

Steve C. Orr [MVP, MCSD]

The value should be available in the Forms collection.

MyVar = Request.Forms("MyHiddenField").ToString()
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top