Results 1 to 7 of 7

Thread: How do you load a webpage using Javascript????

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    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,
    Blake

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    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

  4. #4
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: How do you load a webpage using Javascript????

    window.open opens a new window.
    Set window.location to navigate within the current page.

  6. #6
    Addicted Member
    Join Date
    Mar 2007
    Posts
    183

    Re: How do you load a webpage using Javascript????

    Quote Originally Posted by blakemckenna View Post
    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).
    Do not read this sentence.
    You read that last one, didn't you?
    Darn. You now read the previous two.

    Check out my pins on Pinterest!

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    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,
    Blake

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width