Hey Guys,
Is there any problem in the following code:

TextBox test = (TextBox)Page.PreviousPage.FindControl("search");
        if (PreviousPage != null)
        {
            if (PreviousPage.IsCrossPagePostBack == true)
            {
                Label1.Text = test.Text;
            }
        }
        else
        {
            Label1.Text = "Not a cross-page post.";
        }
kvprajapati commented: Where is code tags? -2

Recommended Answers

All 6 Replies

which error ur getting?

protected void Page_Load(object sender, EventArgs e)
    {

        if (Page.PreviousPage != null)
        {
           TextBox test = (TextBox)Page.PreviousPage.FindControl("search");
           if (PreviousPage.IsCrossPagePostBack == true)
           {
               Label1.Text = test.Text;
           }
           else
           {
               Label1.Text = "Not a cross-page post.";
           }
       }
       
    }

anuj576,
88th post and you forgot to use code tags.

chithrasujith,
Source code must be wrap up with bb code tags.

[code=asp.net] ....

[/code]

88th post and you forgot to use code tags.

chithrasujith,
Source code must be wrap up with bb code tags.
[noparse]
[code=asp.net]
....
[/code]
[/noparse]

Thanks for pointing out.
Chithra

Point Noted

Did you get solution of your problem? If yes then mark this thread as solved. If it is not resolved then ask us.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.