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'
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / geetha
Hi Purushotham,
Thank you very much for your suggestions.Now its working
fine.
Thanks,
Geetha
Is This Answer Correct ? | 0 Yes | 1 No |
How do I force the dispose method to be called automatically, as clients can forget to call dispose method?
Which is better asp.net or php?
How does asp.net work?
What are different templates available in Repeater,DataList and Datagrid ?
What is the concept of view state in asp.net?
What is is post back property in asp net?
what is differences between bind and eval?
What is a web api endpoint?
What is .netmodule and how is different from .dll and .exe
how to add cliet side event to server side? and how to register client script to sever side? wt difference these two
What are validator? Name the validation controls in asp.net?
What's the advantage of using System.Text.StringBuilder over System.String?
3 Answers IBM, IdeaLake, Infosys,