hidden fields?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know that <input type="hidden" fields are used within a form, but do
<ASP:HiddenField s have to be in a form to be used?
I've got a VB-based (codebehind) that catches the click event of a button on
the page, does some processing, populates the <ASP: hidden fields, and then I
need to redirect to another page, where I want access to these fields.
I suspect that these have to be inside a form, but figured I should ask.

I'd use a Cache or cookies, but this is sensitive information (not sensitive
from the user, but sensitive otherwise) and I'm not
sure that cookies will be available in all cases. I figure I can use
HiddenFields unless there's a better way
 
Yes, ASP.NET controls needs to be within the FORM tag, try taking them
outside and see what error message you get !
 
if your page responds with a redirect, you are sending back to the browser
the url to redirect to. your hidden field are of no use, as the browser will
not include them in the redirected request.

-- bruce (sqlwork.com)
 
Well is there another way to get to the next page without a redirect? is
there another way to accomplish what I want without using hidden fields?
 
You could

1.) Pass parameters in the redirection string to the page you redirect to.
2.) Store the information in session before redirection.
3.) Use a standard field, make it tiny and shove it out of the way, set the
forground and background color to the page background color.
 
Is there any way to (within a codebehind) to set up a Continue button, that
will change the form ACTION to a new screen, and that the data will be posted
there instead of posted back?
 
Back
Top