RegisterHiddenField and trace

K

Kevin Spencer

1) Only server controls can appear at the trace page? Is it possible to
make
regular html controls appear at the trace page?

RegisterHiddenField doesn't create a Control. It adds HTML to the page that
renders a hidden form field on the client.
2) Can the RegisterHiddenField method creates a server hidden field, in
order to make it appears at the trace page?

No. The server side is unawarae of any non-Control HTML in the page.
How can I read the value of the
hidden field correctly in my custom control?

Request.Form("hiddenFormFieldName")

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 
E

Erik Cruz

Hi Kevin.

I could successfuly read the contents of the hidden field using the OnInit
event of my custom control when clicking a button for example. But if I
'refresh' the page I loose the value. What is the difference between
refreshing a page and clicking a button? Aren't they both a submit?

TIA,
Erik Cruz
 
E

Erik Cruz

Hi.

I am creating a custom control that uses the RegisterHiddenField method to
insert a hidden field on a page. When I tried to see the value of the hidden
field on a trace, I noticed that it does not appear on the Control Tree
section of the trace. I put a normal hidden field on an aspx page and set it
to run as a server control, and the control appears at the trace info. I
have two questions about this:

1) Only server controls can appear at the trace page? Is it possible to make
regular html controls appear at the trace page?
2) Can the RegisterHiddenField method creates a server hidden field, in
order to make it appears at the trace page?

Also, I tried to inspect the value of the hidden field using Request.Params
in the OnInit event of my custom control. It always returns me "", though I
change the value of the field in Javascript. How can I read the value of the
hidden field correctly in my custom control?

TIA,
Erik Cruz
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top