Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


can we transfer data from one page to another page using
viewstate if so how?if not y?

Answers were Sorted based on User's Feedback



can we transfer data from one page to another page using viewstate if so how?if not y?..

Answer / guest

http://www.codeproject.com/KB/aspnet/TransferingValues.aspx
try out this link

Is This Answer Correct ?    1 Yes 1 No

can we transfer data from one page to another page using viewstate if so how?if not y?..

Answer / ye s

yes

Is This Answer Correct ?    1 Yes 1 No

can we transfer data from one page to another page using viewstate if so how?if not y?..

Answer / bikramjit singh

No we cannot tranfer data from pne page to another using
viewstate. Viewsatate is a atate management technique which
allows to preserve controls property values and class level
variables values for a specific page between postbacks.

We can tranfer data from one page to another using session
object or query string.Session object is a collection
object which can store large amount of data whereas query
string is used to transfer small amount of information from
one page to another.


Bikramjit Singh.

Is This Answer Correct ?    1 Yes 1 No

can we transfer data from one page to another page using viewstate if so how?if not y?..

Answer / sandeep shah

yes its possible , use Server.transfer and you can use the
view state in the destination page only . not that you can
use the view state to some other page.

check this below link for more clarification

http://forums.asp.net/t/1137668.aspx/1

Is This Answer Correct ?    0 Yes 0 No

can we transfer data from one page to another page using viewstate if so how?if not y?..

Answer / jack

TRY THIS it Will WORK



public void Button1_Click(object sender, EventArgs e)
{
ViewState["name"] = TextBox1.Text;
Context.Items.Add("variable", ViewState["name"].ToString());

Server.Transfer("Default2.aspx");
}
//next page

public void Page_Load(object sender, EventArgs e)
{
string myValue = Context.Items["variable"].ToString();
TextBox2.Text = myValue;
}

Is This Answer Correct ?    0 Yes 0 No

can we transfer data from one page to another page using viewstate if so how?if not y?..

Answer / pranit

Yes, we can access the viewstate variables across pages.
This is only possible if Cross Page Posting or
Server.transfer is used to redirect the user to other page.
If Response.redirect is used, then ViewState cannot be
accessed across pages.

StateBag class: This class is the primary storage mechanism
for all HTML and Web server controls. It stores
attribute/value pairs as strings associated with the
control. It tracks changes to these attributes only after
the OnInit method is executed for a page request, and saves
the changes to the page's or control's viewstate.

For
Detail:http://www.codeproject.com/Articles/37753/Access-ViewState-Across-Pages

Is This Answer Correct ?    0 Yes 0 No

can we transfer data from one page to another page using viewstate if so how?if not y?..

Answer / gautam

Conceptually Viewstates are intended for only at page level.They cannot be used to transport data from one page to other as such.Yet there are several workarounds like what we do using Context collection or using previouspage object to obtain public members of previous webpage.

Is This Answer Correct ?    0 Yes 0 No

can we transfer data from one page to another page using viewstate if so how?if not y?..

Answer / senthil kumar

Yes, we can access the viewstate variables across pages. This is only possible if Cross Page Posting or Server.transfer is used to redirect the user to other page.

Refs Urls: http://www.codeproject.com/Articles/37753/Access-ViewState-Across-Pages

Note :
If Response.redirect is used, then ViewState cannot be accessed across pages.

Is This Answer Correct ?    0 Yes 0 No

can we transfer data from one page to another page using viewstate if so how?if not y?..

Answer / shyam

//*http://www.codeproject.com/KB/aspnet/TransferingValues.aspx*//
in this link they have used Response.redirect("abcd.aspx").
but by using Server.transfer("abcd.aspx")the case is
different.no page postpack is happening there..so i think by
using Server.transfer (not by Response.redirect)view state
data can be transfered acros the pages.

Is This Answer Correct ?    3 Yes 4 No

can we transfer data from one page to another page using viewstate if so how?if not y?..

Answer / pradip

No, We Cant.......
Even we use Server.Transfer it's not possible because it's
only at page level.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

Where would you use an IHttpModule, and what are the limitations of anyapproach you might take in implementing one?

1 Answers   Siebel Systems,


Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?

2 Answers   Siebel Systems,


How do you retrieve information from web.config ?

5 Answers   MMTS,


Difference between datareader and dataset ?

4 Answers   Microsoft,


Whats an assembly?

6 Answers   Siebel Systems,


What type of code (server or client) is found in a Code-Behind class?

3 Answers   Siebel Systems,


Securitywise What are the Enhancements in 2.0?

0 Answers   Microsoft,


What is the purpose of using MVC programming pattern in ASP.NET?

0 Answers   PUCIT,


ASP.NET Web Service

1 Answers  


What is http response header?

0 Answers  


i have one gridview contains edititemtemplate(which contains update and cancel buttons) and i have one item template (contains edit button) i want the code for update and cancelbuttons in edit item template and i want the code for edit button in itemtemplate. please help me

4 Answers  


How to write unmanaged code and how to identify whether the code is managed / unmanaged ?

2 Answers   Accenture, BirlaSoft, Cogtest,


Categories