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 about asp.net state management?
Explain the various authentication mechanisms in asp.net.
How does the cookies work in asp.net?
What is web configuration file and how to use in web application
What is web api vs wcf?
can s/w quality assurance engineer switch field to programming side i m very much interested in programming but not much good in it
Explain ViewState?
Differences between “dataset” and “datareader”.
What is the function of new view engine in asp.net? : asp.net mvc
What are the event handlers that can be included in the Global.asax file?
Explain what are the advantages of asp.net mvc framework? : asp.net mvc
What is owin authentication?
How can I configure asp.net applications that are running on a remote machine?
Describe the .net base class library.
What are the disadvantages of view state?