I'm so tired of trying to find out how to load an aspx page from an existing aspx page using Javascript. I can't seem to get a straight answer. Can someone please show me a working example?
Thanks,
Printable View
I'm so tired of trying to find out how to load an aspx page from an existing aspx page using Javascript. I can't seem to get a straight answer. Can someone please show me a working example?
Thanks,
Window.open is the JS function to direct the current page to a new page
http://www.w3schools.com/jsref/met_win_open.asp
But this terminology you used is confusing...
"to load an aspx page from an existing aspx page "
Load - what does that verb mean?
Perhaps that's my lack of knowledge of web development. I have a masterpage called Site1.master. My starting page is called Menu1.aspx. I'm trying to call Main3.aspx from within the Menu1.aspx page from a Javascript function. I want the page to be displayed in the current session and not a new Window.
Then window.open will direct the current page to a new url.
Once your ASPX page renders you are in the browser - it's stateless - it knows not where it came from. So you have to direct the BROWSER to go someplace - the original aspx page is a fleeting memory...
window.open opens a new window.
Set window.location to navigate within the current page.
Well, I'm assuming #3, but I'm not positive if that's the way to do it. Keep in mind, I'm using a MasterPage. Main1.aspx is the startup page. This page consists of a menu and an image. When a menu item is clicked on, that's when I wish to load/show Main3.aspx. The Main3.aspx page is controlled mostly using Javascript functions. When calling the Main3.aspx page, I need to pass a parameter which is the menu item that was clicked on.Quote:
Do you mean:
1) you want to embed Main3.aspx in Main1.aspx,
2) you want the user to be redirected to Main3.aspx,
or 3) you want to use JavaScript in Main1.aspx to call a function that is found in Main3.aspx?
Hope this helps!
Thanks,