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
Why asp.net mvc is better than asp.net? : Asp.Net MVC
What is Web Server Control Templates.?
What is web router?
Explain exception handling in .net.
How do we ensure view state has not tampered?
In which event of the page life cycle, is the viewstate available?
Can we use a static function with a non-static variable?
If there are multiple update panels on the page say upd1 and upd2. There is a button placed in upd1. How can you stop upd2 to update when button placed in upd1 is clicked?
Can we set which type of comparison we want to perform by the CompareValidator control?
Can you explain the importance of finalize method in .net?
Why do we need a web application session?
How do I use a proxy server when invoking a web service?
What do you mean by role-based security?
What is session in web technology?
What is route in web api?