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 a 404 redirect?
Give 2 examples for scenarios when routing is not applied?
Explain the path instructions in xaml?
What are the security types in asp.net?
How do cookies work? Give an example of their abuse.
What are the parts of an http response?
What is asp.net and its advantages?
What’s the use of “GLOBAL.ASAX” file?
What are the modes of updation in an updatepanel? What are triggers of an updatepanel?
what are the security certificates used in webservices?
What is the full form of asp.net?
Explain about Application and Session Events ?
What is http post and http get?
Describe in brief .net framework and its components.
Can one dll file contains the compiled code of more than one .net language?