-
Feb 15th, 2012, 08:24 PM
#1
Thread Starter
PowerPoster
How do you load a webpage using Javascript????
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,
-
Feb 15th, 2012, 08:33 PM
#2
Re: How do you load a webpage using Javascript????
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?
-
Feb 15th, 2012, 08:36 PM
#3
Thread Starter
PowerPoster
Re: How do you load a webpage using Javascript????
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.
Last edited by blakemckenna; Feb 15th, 2012 at 08:42 PM.
Blake
-
Feb 15th, 2012, 08:40 PM
#4
Re: How do you load a webpage using Javascript????
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...
-
Feb 15th, 2012, 09:58 PM
#5
Re: How do you load a webpage using Javascript????
window.open opens a new window.
Set window.location to navigate within the current page.
-
Feb 17th, 2012, 07:50 PM
#6
Addicted Member
Re: How do you load a webpage using Javascript????
Originally Posted by blakemckenna
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.
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?
I'm assuming either 1) or 2).
-
Feb 17th, 2012, 08:10 PM
#7
Thread Starter
PowerPoster
Re: How do you load a webpage using Javascript????
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?
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.
Hope this helps!
Thanks,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|