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
What is the difference between “Web.config” and “Machine.Config”?
Explain the main function of razor in asp.net? : asp.net mvc
How to you can limit Access to Web API to Specific HTTP Verb?
Explain the boxing and unboxing concept in .net?
What is is post back property in asp net?
Explain swagger components.
What is a master page and what does it do?
What is the use of global.asax file?
Define the term Web Garden?
What is the difference between adding reference in solution explorer and adding references by using ?
Tell me the code snippet to show how we can return 404 errors from HttpError?
Which object is used to encapsulate the state of the client and the browser in ASP.NET?
Describe the differences between the lifecycles of Windows services and Standard EXE?
Describe the diffeerence between inline and code behind?
What is the use of the tag in the web.config file?