Click here to Skip to main content
15,999,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using request.form to get the value of the hidden field from a prevoius page but its alwasys showing as null or empty value.
i am using server.tranfer to go to the next page.

how to solve this?
Posted

Is it an actual HiddenField or a TextBox that has its visible property set to false?

If it is a TextBox that has its visible property set to false then it will not be rendered on the page and always returns empty.

A hidden field needs to de defined as;
XML
<asp:HiddenField ID="testHidden" Value="" runat="server"/>

or
HiddenField test = new HiddenField();
test.ID = "testHidden";
test.Value = string.Empty;
container.Controls.Add(test);
 
Share this answer
 
Yes its a hiddenfield.I will try by adding Value property to it.
What is the difference with adding Value property and without value property?

Also can you please tell me how to get the value of datagrid or checkbox or dropdownlist in a hiddenfield?

Thanks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900