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