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. Page navigation using javascript

Page navigation using javascript

Scheduled Pinned Locked Moved ASP.NET
javajavascripttoolshelpquestion
2 Posts 1 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.
  • K Offline
    K Offline
    KishoreT
    wrote on last edited by
    #1

    I have a navigation links(Page1, PAge2, etc) in Master page. when user mouseover on the asp links(Page1, page2) in the navigation bar, a popup menu(ex: Add, Edit, Delete) is shown. when the user selects the menu item(ex: Add) clicked, the following javascript is executed.

    window.location.pathname = Page1/Admin/xyz.aspx?action=add"

    http://SiteName/page1/Admin/xyz.aspx?action=add;

    page is opened. and the address bar having the above mentioned path when I again do the mouseover on the page1 , the popup menu is shown, then if I clicked "Edit" in popup menu the same page should be opened but the action = edit i.e the following java script is executed. <pre>window.location.pathname = Page1/Admin/xyz.aspx?action=edit"</pre> but the page address bar is showing in the following way

    window.location.pathname = Page1/Admin/xyz.aspx?action=add?action=add"

    is shown. in serverside

    Request["action"]

    value is shown as "add?action=Edit" why the data passed along with the links is continuing for other address also, even if the page is not the same? am i doing any mistake here? please help me...

    K 1 Reply Last reply
    0
    • K KishoreT

      I have a navigation links(Page1, PAge2, etc) in Master page. when user mouseover on the asp links(Page1, page2) in the navigation bar, a popup menu(ex: Add, Edit, Delete) is shown. when the user selects the menu item(ex: Add) clicked, the following javascript is executed.

      window.location.pathname = Page1/Admin/xyz.aspx?action=add"

      http://SiteName/page1/Admin/xyz.aspx?action=add;

      page is opened. and the address bar having the above mentioned path when I again do the mouseover on the page1 , the popup menu is shown, then if I clicked "Edit" in popup menu the same page should be opened but the action = edit i.e the following java script is executed. <pre>window.location.pathname = Page1/Admin/xyz.aspx?action=edit"</pre> but the page address bar is showing in the following way

      window.location.pathname = Page1/Admin/xyz.aspx?action=add?action=add"

      is shown. in serverside

      Request["action"]

      value is shown as "add?action=Edit" why the data passed along with the links is continuing for other address also, even if the page is not the same? am i doing any mistake here? please help me...

      K Offline
      K Offline
      KishoreT
      wrote on last edited by
      #2

      Sandeep Mewara has posted an answer to your question "Popup menu and page redirection using javascript": KishoreT wrote: why the data passed along with the links is continuing for other address also, even if the page is not the same? Though you have not posted the code that parses or forms the navigation URL, it is clear from your issue that you are not re-setting the querystring variable/parameter that to append to your base URL. You keep a URL to navigate and based on the add/edit/delete selection you go ahead and append that value to the base URL. while appending reset the query string parameter. Resetting would remove the old value. hi sandeep, sorry while writing the post i made that mistake. the actual javascript is

      window.location.pathname = Page1/Admin/xyz.aspx?action=edit

      but in the address bar it was viewed after the page load is

      href="http://SiteName/page1/Admin/xyz.aspx?action=add?action=edit

      so I get an error that Request["action"] value at server side;

      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