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 4002056
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:58:47+00:00 2026-05-20T07:58:47+00:00

I am just starting to learn jQuery, and want to load content from a

  • 0

I am just starting to learn jQuery, and want to load content from a seperate .aspx page dynamically into a div. Using example from here: http://www.asp.net/ajaxLibrary/jquery_webforms_dynamic_load.ashx?HL=var.

However it doesn’t seem to be responding and I’m probably missing some piece of this. Here is the code / script in my .aspx page:

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script src="Scripts/jquery-1.5.js" type="text/javascript"></script>       
<script type="text/javascript">

$(document).ready(function () {
    // External ASPX Page calling   
    $("#btn_Submit").click(loadDynamic);
});

function loadDynamic() {

    $("#dynamicResults").load("ResultsView.aspx", 
        {name: $("#cbox_User").val() },  
        function (content) {   
           $(this).hide().fadeIn("slow");
                return false;
        });
}  

<Header>
QUERY VIEW
</Header>

<Content>
    <div style="float:right; height:154px; width: 947px; margin-left: 0px; background-color: #E0E0E0;">
        <br />
        <asp:Label ID="Label2" runat="server" Text="Select a User:" 
                    Style="margin-left:28px" ></asp:Label>

                    <asp:ComboBox ID="cbox_User" runat="server" AutoCompleteMode="SuggestAppend">
                    </asp:ComboBox>

                <asp:Label ID="Label3" runat="server" Text="Select a Month:" 
                                Style="margin-left:28px" ></asp:Label>
            <asp:TextBox ID="txt_Date" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender1" runat="server" 
                            TargetControlID="txt_Date" 
                            Format="MMMM yyyy" 
                            OnClientShown="onCalendarShown"
                            OnClientHidden="onCalendarHidden"
                            BehaviorID="calendar1" >
                </asp:CalendarExtender>
                <asp:Button ID="btn_Submit" runat="server" Text="Submit" Style="margin-left:28px" onclick="Btn_Submit_Click" />
</div>
</Content>


<Header>
RESULTS VIEW
</Header>

<Content>
    <div id="dynamicResults">
    </div>
    <div style="border-style: none; height:340px; width: 770px; position:relative; top: 10px; left: -2px;">
     <asp:GridView ID="ResultsView" runat="server" CellPadding="3" 
         ForeColor="Black" GridLines="None" AllowPaging="False" 
         Visible="False" 
         Height="318px" style="margin-left: 32px; margin-top: 2px;" Width="718px" 
         BackColor="White" BorderColor="#999999" BorderStyle="Solid" 
         BorderWidth="1px">
        </asp:GridView>
     </div>
</Content>

And in the second .aspx page, which contains I a div I just want to dynamically load:

<html xmlns="http://www.w3.org/1999/xhtml">
   <div style="background-color:#E0E0E0; border-style: ridge none none none; border-        width: thin; border-color: #B3B3B3; height:120px; width: 770px;  position:relative;     top: 10px; left: 8px;">
          <asp:Label ID="lbl_Header" runat="server" Text="User  Information:"></asp:Label>
   </div> 
 </html>
  • 1 1 Answer
  • 1 View
  • 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-05-20T07:58:47+00:00Added an answer on May 20, 2026 at 7:58 am

    Have a look at the load method.

    Here is an example from the page:

    Loading Page Fragments The .load()
    method, unlike $.get(), allows us to
    specify a portion of the remote
    document to be inserted. This is
    achieved with a special syntax for the
    url parameter. If one or more space
    characters are included in the string,
    the portion of the string following
    the first space is assumed to be a
    jQuery selector that determines the
    content to be loaded.

    We could modify the example above to
    use only part of the document that is
    fetched:

    $('#result').load('ajax/test.html #container');
    

    When this method executes, it
    retrieves the content of
    ajax/test.html, but then jQuery parses
    the returned document to find the
    element with an ID of container. This
    element, along with its contents, is
    inserted into the element with an ID
    of result, and the rest of the
    retrieved document is discarded.

    jQuery uses the browser’s .innerHTML
    property to parse the retrieved
    document and insert it into the
    current document. During this process,
    browsers often filter elements from
    the document such as , ,
    or elements. As a result, the
    elements retrieved by .load() may not
    be exactly the same as if the document
    were retrieved directly by the
    browser.

    Edit: Just noticed that in your function loadDynamic() you’re trying to get the value of the control cbox_User like this:

    $("#cbox_User").val()
    

    But, because it’s a server-side control, you need to get the value like this:

    $("#<%=cbox_User.ClientID%.").val()
    

    This is because .NET gives ASP.NET controls different id’s than what you specify.

    Hope this helps.

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

Sidebar

Related Questions

Just starting to learn ASP.NET (C#) and I am using Visual Studio 2008. I
I'm just starting to learn about jQuery. I'm more of a html+css web designer
I'm just starting to learn about jQuery and am becoming familiar with how jQuery
I'm just starting to learn JavaScript, and stumbled over Underscore.js and jQuery . Underscore
I'm just starting to learn android programming and I want to ask you good
I am just starting to learn Python, but I have already run into some
A friend is just starting to learn Java, using IntelliJ. He asks how can
I'm just starting to learn Java database persistence using Hibernate ORM and have run
Just starting to learn Ruby on Rails. I'm using RoR 3. I have read
I'm just starting to learn flex and AS3 I'm trying to get information into

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.