Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Previous Page

Previous Page

Scheduled Pinned Locked Moved ASP.NET
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Munteanu Ciprian
    wrote on last edited by
    #1

    Ok, here's my problem. I have two pages: one called FirstPage.aspx and the other one called SecondPage.aspx. Here's what I want to do... I start with FirstPage.aspx and here I have a button and when I click it SecondPage.aspx appears. I do that using Response.Redirect("SecondPage.aspx", false). Ok, now when it loads the second page I want to show in a label the name of the first page. How can I do that? If I have used the PostBackUrl property of the button from the first page, this would have been easy. I would have written in the SecondPage: protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null) { Label1.Text = PreviousPage.Title; } } But, I need to show the second page using Response.Redirect("SecondPage.aspx", false). So any help?

    A 1 Reply Last reply
    0
    • M Munteanu Ciprian

      Ok, here's my problem. I have two pages: one called FirstPage.aspx and the other one called SecondPage.aspx. Here's what I want to do... I start with FirstPage.aspx and here I have a button and when I click it SecondPage.aspx appears. I do that using Response.Redirect("SecondPage.aspx", false). Ok, now when it loads the second page I want to show in a label the name of the first page. How can I do that? If I have used the PostBackUrl property of the button from the first page, this would have been easy. I would have written in the SecondPage: protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null) { Label1.Text = PreviousPage.Title; } } But, I need to show the second page using Response.Redirect("SecondPage.aspx", false). So any help?

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      Just pass the value using Querystring... Do like this when you navigate to the second page: Response.Redirect("secondpage.aspx?name=" + pagename); After you redirect, you will find the value of name easily. In Page_load : protected void Page_Load(object sender, EventArgs e) { string firstpagename = Request.QueryString["name"]; Label1.Text = firstpagename; } I think this is what you needed. Cheers. :rose:

      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


      My Latest Articles-->** Simplify Code Using NDepend
      Basics of Bing Search API using .NET
      Microsoft Bing MAP using Javascript

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups