2
Answers

Crosspage Postback

I had done a demo of crosspage Postback but on this syntax 

LblTARGET = (Label)Page.PreviousPage.FindControl("LblSOURCE");

it is returning null value.... that is the LblSOURCE control is not being detected even if it is in the source page

LblTARGET  is a label control in the target page .

the total code is

if (Page.PreviousPage != null)

{

LblTARGET = (Label)Page.PreviousPage.FindControl("LblSOURCE");

if (LblTARGET != null)

TxtTARGET.Text = LblTARGET.Text;

else

Response.Write("UNSUCCESSFUL");

}

The statement with response.write is getting executed even though 

if (Page.PreviousPage != null) this condition is getting satisfied

PLEASE REPLY AS SOON AS POSSIBLE.

Answers (2)