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
Explain the Order of events in an asp.net page?
What is protected configuration?
How would you create a permanent cookie?
Write code to send e-mail from an asp.net application?
How may clustered index we can create in table?
What is the file through which you can customize your asp.net application?
What do you mean by View State and what is its role?
How ViewstateMac works?
What is a 401 redirect?
What do you mean by query string?
What is caching? Explain.
Out of ASP or ASP.NET which one is stateless?
What is difference between web api and web services?
What is asynchronous call?
What is web api config?