3

I have two aspx pages, the first that has 5 links. All 5 links use Server.transfer("page_x.aspx");

My problem is once the transfer is complete I'm left with my original 5 links plus the new data. How can I clear the original page's content and then load the new data from the link that was clicked? I tried using Controls.Clear(); and then issuing a Server.transfer but that did not work.

Servy
  • 202,030
  • 26
  • 332
  • 449
snapplex
  • 851
  • 3
  • 13
  • 27

1 Answers1

6

You can make use of Response.Redirect("page_x.aspx");

This transfers control to new page and there is no need to do any extra work for this.

Servy
  • 202,030
  • 26
  • 332
  • 449
Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
  • That has a number of side effects that may or may not be desirable. It makes another round trip back to the user's browser. It changes the URL in the browser, and affects the history. Now if this is really what's appropriate in context, fine, but it's not like it's the exact same thing but with a response wipe. – Servy Jan 11 '13 at 18:43
  • @Servy - agreed with this but i answered as per my understanding ..and if there is need of any data transfer than use state maintenance... but if there is anything more added i can do changes in answer according to that.. – Pranay Rana Jan 11 '13 at 18:46
  • Actually Response.Redirect was my initial thought but I'm begin specifically asked to use "Server.transfer" so I'm assuming at some point the data will be referenced down the line. – snapplex Jan 11 '13 at 19:40