0

I have this is my first page FirstPage.aspx

protected void GridName_SelectedIndexChanged(object sender, GridViewSelectEventArgs e)
        {
                String Url = String.Empty;

                int index = e.NewSelectedIndex;

                String Name = String.Empty


                Name = GridName.DataKeys[index].Values["Name"].ToString()

                Url = "RetrieveAddress.aspx?Name= " + Name.ToString();
                Response.Redirect(Url, false);      
                Context.ApplicationInstance.CompleteRequest();

        }

Now, using the Name parameter from the FirstPage.aspx, How to retrieve the address for the corresponsing name in FirstPage.aspx?

In simple words, I need to retrieve the address for the Name (parameter sent from first page) in my second page RetrieveAddress.aspx.

What should be my full code in second page? Please help

4
Contributors
3
Replies
14
Views
4 Years
Discussion Span
Last Post by JorgeM
0

Make me correct if i am wrong..
what my understanding is,
you want to retrive the address on second page based on the name you selected on first page.
seems. first you will select name from the first page and then click on Next button to direct next page and you are fetching address here. aren't you?

if you are. than you can store name into a session while they are selecting name on first page and you can use session value for fetching address for the name.

0

Request.QueryString["Name"] will get you the query parameter named "Name".

If you need the name of the page:
string refPage = Request.UrlReferrer.ToString();

0

Now, using the Name parameter from the FirstPage.aspx, How to retrieve the address for the corresponsing name in FirstPage.aspx?

I think that hookedtocsharp is trying to retrieve the "Name" parameter on RetrieveAddress.asp. If that is the case, you can use Request.QueryString["Name"] to capture it during the page load and assign it to a variable.

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.