Click here to Skip to main content
15,900,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to pass the value from one page to other page using viewstate
And also write the code in c#
Posted

refer this blog
http://upendrachowdare.blogspot.com/[^]
Saturday, January 9, 2010
How to access ViewState value in Other Page
It is now posible form the .net 2.0(2005 version).

u just use/Set the "previouspage" property in the which page u wanted .
example (form 1 u have the "testbox1"

u want to access the value of textbox1 from default1.aspx"

so now u u open default2.aspx

in the code behind just set the following code

page obj=this.previouspage;
testbox txtobj=obj.findcontrol("textbox1");// here u get the data from page1 to page2
string str=txtobj.text;
 
Share this answer
 
Refer to this[^] article.
It briefly describes different techniques for passing data between web pages (ViewState is also included).
As you can see in the article the general purpose of ViewState object is for storing objects between postbacks to the same web page.
You should consider the other techniques for passing data between web pages.

I hope this helps you. :)

Regards
 
Share this answer
 
v3
ViewState is specific to page and is not designed to pass values around pages. You need alternative techniques like passing through URL or session etc.
 
Share this answer
 
Best way to send the info to other page by request querystring. Mostly avoid the session.
 
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