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...

I am using ASP.Net 2.0. I added the following code in
button_Click page. but 'PreviousPage' is not taking as a
keyword. It throughs an error.

Page Poster = this.PreviousPage;

TextBox txtNewTest = (TextBox)Poster.FindControl("txtTest");

sDisplay = txtNewTest.Text;

Response.Write(sDisplay);

The following is the Error Message:

'controls_LoginMain' does not contain a definition
for 'PreviousPage'

Answer Posted / purushotham

hi u have 2 use previous page directive in page where u
want 2 access previous page controls.
aspx:

<%@ PreviousPageType VirtualPath="~/Default.aspx" %>

aspx.cs:
TextBox txt= (TextBox)Page.PreviousPage.FindControl
("TextBox1");
Response.Write(txt.Text.ToString());

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between “Web.config” and “Machine.Config”?

1143


Explain the main function of razor in asp.net? : asp.net mvc

1088


How to you can limit Access to Web API to Specific HTTP Verb?

1195


Explain the boxing and unboxing concept in .net?

866


What is is post back property in asp net?

1023


Explain swagger components.

1013


What is a master page and what does it do?

932


What is the use of global.asax file?

1069


Define the term Web Garden?

960


What is the difference between adding reference in solution explorer and adding references by using ?

1089


Tell me the code snippet to show how we can return 404 errors from HttpError?

1285


Which object is used to encapsulate the state of the client and the browser in ASP.NET?

1104


Describe the differences between the lifecycles of Windows services and Standard EXE?

1208


Describe the diffeerence between inline and code behind?

1033


What is the use of the tag in the web.config file?

967