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

The technical part was on ASP.Net only of web services.

1 Answers   Symphony,


Explain significance of routing? : asp.net mvc

0 Answers  


What are the various ways to send content from one page to another?

0 Answers  


What namespace does the Web page belong in the .NET Framework class hierarchy?

3 Answers   Siebel Systems,


What is boxing and how it is done internally?

1 Answers   Microsoft,






What is strong-typing versus weak-typing?

0 Answers  


What is the appSettings Section in the web.config file?

0 Answers   MindCracker,


How do you do client-side validation in .net? How to disable validator control by client side javascript?

0 Answers  


What is the behavior of a Web browser when it receives an invalid element?

0 Answers   MindCracker,


What are the uses of reflection?

0 Answers  


Explain in what order a destructors is called.

0 Answers  


In a page I have gridview with options of select and delete using hyperlink when I am selecting any one of then it has to open another page how can it?

0 Answers  


Categories