Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8302727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:21:26+00:00 2026-06-08T17:21:26+00:00

I have a simple aspx page with a link to load another aspx page

  • 0

I have a simple aspx page with a link to load another aspx page on right div (using JQuery load), like that:

<%@ Page Title="Home Page" Language="C#"  AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<html>
<head>
   <script type="text/javascript" src="Scripts/jquery-1.6.2.js"></script>
</head>
<body>
<form id="form1" runat="server">

    <script type="text/javascript">
        function loadPage() {
            $('#myRightdiv').load('Test.aspx', function () {});
        }
    </script>

 <asp:Button ID="Button1" runat="server" Text="Load ..." OnClientClick="loadPage(); return false;" />
 <div id="myRightdiv"></div>
 </form>

In my Test.aspx I have a pageLoad like that:

<%@ Page Title="Test" Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="About" %>

<html>
<head id="Head1" runat="server">
  <title></title>
</head>
<body>
<form id="form1" runat="server">
  <asp:ScriptManager ID="ScriptManager1" runat="server" />
  <script type="text/javascript">
    function pageLoad() {          
       alert("pageloaded");
    }        
  </script> 

</form>
</body>
</html>

That works fine on ASP .NET 3.5 …. But using .NET 4.0 the pageLoad is not fired!

Any idea or workaround?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:21:27+00:00Added an answer on June 8, 2026 at 5:21 pm

    The special pageLoad function is called when the Microsoft Ajax Library has finished initializing the Sys.Application object. Unfortunately, this initialization code was drastically rewritten in ASP.NET 4.0 (details below), and now, in standards-compliant browsers, Sys.Application doesn’t get initialized at all when a page is loaded by the jQuery load function. Fortunately, there’s a simple workaround: initialize Sys.Application yourself:

    $('#myRightdiv').load('Test.aspx', function () { Sys.Application.initialize(); });
    

    I tested this fix in IE9 (Standards mode), Firefox, and Chrome.

    To get your example to work in IE9 (Quirks mode), you also need to move your pageLoad function up into the <head>.

    What Changed Between ASP.NET 3.5 and ASP.NET 4.0

    In ASP.NET 3.5, the <asp:ScriptManager> control inserts a call to Sys.Application.initialize() right before the </form> tag. When jQuery loads Test.aspx, it executes each <script> in sequence, so your pageLoad is defined before Sys.Application.initialize() calls it, and everything works.

    In ASP.NET 4.0, the <asp:ScriptManager> control no longer inserts that bit of JavaScript. Instead:

    • In browsers that support document.addEventListener [such as IE9 (Standards mode), Firefox, and Chrome], the Sys.Application constructor adds a DOMContentLoaded event listener that calls Sys.Application.initialize(). But DOMContentLoaded was already raised when the browser finished loading the current page (Default.aspx). Loading Test.aspx via an AJAX request won’t cause the browser to re-raise DOMContentLoaded.

    • In browsers that support document.attachEvent but not document.addEventListener [such as IE9 (Quirks mode)], the Sys.Application constructor calls Sys.Application.initialize() if the browser has finished loading the current page (which it has, since the current page is Default.aspx). In this case, you need to define your pageLoad function before MicrosoftAjax.js is included; a good place is the <head>.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Asp .net page like this simple one http://issamsoft.com/app2/page1.aspx and I want
I have simple aspx page that has a form and a input field in
I have calender datetimepicker jquery. when I am calling this in simple aspx page
I have a simple aspx page that streams Infopath form data to the client.
I have a main page (Home.aspx) and on selecting a link from the menu
I have a simple master page (master.aspx), which has 3 link buttons namely HomeLBTn-which
I have a simple aspx page with a few TextBoxes and a submit button.
I have an ASPX page (with VB Codebehind). I would like to extend the
I have noticed that, from Google Maps page, you can get an embed link
I am using .NET2.0. Let's say a have a simple aspx form with txtInput

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.