Click here to Skip to main content
16,017,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to get Hidden Field value of a ASPX page in a class file other than code behind of the ASPX page.For Example A.aspx is having some hidden field and I want to use it in A.cs which is not the code behind of A.aspx.How can I do this???
Posted
Updated 9-Apr-13 0:37am
v2
Comments
bbirajdar 9-Apr-13 5:49am    
First get it in codebehind and then pass it to the class file method
Monster Maker 9-Apr-13 5:54am    
Do you have to pass hidden field, or value of hidden field to another class??
Sagar Devanahalli 9-Apr-13 5:56am    
i want to pass a hidden field value to another class file method,in which the method is a get method.So is it possible to pass the value to get method?
PrashantSonewane 9-Apr-13 6:08am    
Can you access class without submitting the page? Where you are calling the class method? in HTML of page or java script function? You need to submit the page and hence get the value first to page and then pass it to class.
Sagar Devanahalli 9-Apr-13 6:20am    
i'm calling the class method in code behind.

If you want to access it directly on code files other than code behind file then -- "You cannot do it". Instead you can access the hidden field in code behind and pass it to the class file.

Alternative solution:
You can store the value of HiddenField in session and then you can access the value of the hidden field in any code file throughout the application.


--Amit
 
Share this answer
 
Hidden field is not so useful when you want this value across the pages.
use session or cookie (state mamagement ) for accessing this values across the pages.
 
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