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'

Answers were Sorted based on User's Feedback



I am using ASP.Net 2.0. I added the following code in button_Click page. but 'PreviousPage�..

Answer / 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

I am using ASP.Net 2.0. I added the following code in button_Click page. but 'PreviousPage�..

Answer / geetha

Hi Purushotham,

Thank you very much for your suggestions.Now its working
fine.


Thanks,
Geetha

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

what do machine key element in configuration file specify?

1 Answers   TCS,


What is a web api? Which protocol is used in a web api?

0 Answers  


is it possible to use web site without web server from remote place?

1 Answers   ABC, Mannar Company, Quadrant,


What is synchronous and Asynchronous post back ?

0 Answers  


Where is asp.net session stored?

0 Answers  


What are the different validators in asp.net?

0 Answers  


what is strong name?

4 Answers   Fidelity, Infosys, Microsoft, Shriram Value Services,


what is the MSIL assembler do?

1 Answers  


How does http session work?

0 Answers  


What websites use asp.net?

0 Answers  


How to reduce the width of textbox in editcommandcolumn of datagrid?

0 Answers  


How do you declare delegates and are delegates and events one and the same and explain how do you declare delegates and invoke them ?

1 Answers   MMTS,


Categories