0

Hi
i have three gridview in one page say form1.aspx.Initially when the page is loading only first two gridview should appear.When i click any of the hyperlink in the first two gridview it will navigate to another page say form2.aspx which has a button . If i click on this button it will navigate to the previous page. Only at this point of time my third gridview should be visible.Please be clear in your answer as i am new to .net

In the page load event of form1.aspx i will make
Gridview3.visible=false;

in the button click event of form2.aspx i will redirect the page as
response.Redirect("Form1.aspx")
At this point of time the third gridview in form1 should be visible.
At which part of code in form1.aspx i should make the gridview visibility true?

2
Contributors
1
Reply
4
Views
7 Years
Discussion Span
Last Post by croker10
0

kaaviya,

Have you tried using a session variable?

This is a trick I use often to tell what page I am navigating from.

To do this I do:

HttpContext.Current.Session["PreviousPage"] = "form2";

and then on form 1, do something like,

if(HttpContext.Current.Session["PreviousPage"] != null && HttpContext.Current.Session["PreviousPage"] == "form2")
    Gridview2.visible = true;
else
    Gridview2.visible = false;

HttpContext.Current.Session["PreviousPage"] = null;

Make sure to clear the value in the session variable when you no longer need it or it may cause a problem if you try to use it again.

Hope that helps.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.