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
Is asp.net still used?
How can we use Web API with ASP.NET Web Form?
What is windows active directory authentication?
Is razor a programming language?
What is sta?
What is a session http?
Explain the boxing and unboxing concept in .net?
Explain parts of assembly?
Why we use dbms for projects? Why don’t we save any application data in separate files instead of dbms?
Distinguish between Server-side and Client-side code?
How does session state work in asp.net?
Explain diff. Between friend and protected friend?
How do you sign out from forms authentication?
Define data caching?
How do you do Client-side validation in .Net?