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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:23:55+00:00 2026-05-25T23:23:55+00:00

I have a page that runs a jquery onclick event. The event loads an

  • 0

I have a page that runs a jquery onclick event. The event loads an an external .aspx file into a div. The page that’s being loaded has a drop down list with an autopostback attribute that passes the selected item to a label.

Everything works fine except that the .aspx file that’s being loaded will only post back once. After that no more autopostback. Here’s my code

—– external.aspx ——

 <script> 
protected void ddlPrices_SelectedIndexChanged(object sender, EventArgs e)
   {
    lblPrice.Text = ddlPrices.SelectedValue.ToString();
   }
 </script>


<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
<asp:DropDownList ID="ddlPrices" runat="server" AutoPostBack="true" 
    onselectedindexchanged="ddlPrices_SelectedIndexChanged">
<asp:ListItem>Basic</asp:ListItem>
<asp:ListItem>Pro</asp:ListItem>
<asp:ListItem>Platinum</asp:ListItem>
<asp:ListItem>Baller!</asp:ListItem>
</asp:DropDownList> 

<asp:Label ID="lblPrice" runat="server"></asp:Label>          
</ContentTemplate>
</asp:UpdatePanel>

—- default.aspx ——

<script>
$(document).ready(function () {
$("li#empNav1").click(function () {
$("div.subItem").load('external.aspx');
});
});
</script>

 <ul class="nav-left">
<li id="empNav1" class="selected"><a href="#">Employer Overview</a></li>
<li id="empNav2"><a href="#">Why We're Better</a><span></span></li>
</ul>
<div class="subItem"></div>

As stated the div loads just fine, but external.aspx will only update lblPrice once. Then it no longer auto updates. Any help would be greatly appreciated specifics please….

UPDATE: I’ve tried putting an update panel in default.aspx around the div that being loaded that also didn’t cut it.

  • 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-05-25T23:23:56+00:00Added an answer on May 25, 2026 at 11:23 pm

    Well $.load() actually copies the HTML from the requested URL and “pastes” it into the target container. It’s possible that the ViewState of the parent page is conflicting with that of the page you are loading so the PostBack call to the ddlPrices_SelectedIndexChanged method is not being found.

    I would suggest putting your dropdown code into a UserControl and just keep your ScriptManager and UpdatePanel on the parent page.

    So you could make something like CTRLPriceList.ascx which would just have:

    <asp:DropDownList ID="ddlPrices" runat="server" AutoPostBack="true" 
        onselectedindexchanged="ddlPrices_SelectedIndexChanged">
    <asp:ListItem>Basic</asp:ListItem>
    <asp:ListItem>Pro</asp:ListItem>
    <asp:ListItem>Platinum</asp:ListItem>
    <asp:ListItem>Baller!</asp:ListItem>
    </asp:DropDownList> 
    
    <asp:Label ID="lblPrice" runat="server"></asp:Label> 
    

    And its Code Behind would be:

    protected void ddlPrices_SelectedIndexChanged(object sender, EventArgs e)
    {
        lblPrice.Text = ddlPrices.SelectedValue.ToString();
    }
    

    To really explore what’s happening, you should use an HTML debugger like Firebug or Chrome’s built-in one which let you see what’s being rendered in the DOM in real-time (eg. after the $.load() is processed). I have a feeling loading a full ASPX page into another will look very messy and is probably not a good idea even if you do get it to work.

    Also check for Javascript errors.

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

Sidebar

Related Questions

I have a webpage that loads and runs jquery once the page is ready,
I have a simple jQuery code that runs on a web page that has
I have some jQuery that runs on a page. As a short-term fix I
I have a page that is using jQuery to load an XML file, which
I have some jQuery code that runs on every $(document).ready() event. I also have
When the page loads I have an initial replaceWith that runs the following code:
I have and external JS scripts file with all my objects in that runs
I have a web page that loads in an IFRAME, that runs correctly in
I have a jQuery function that runs through the page, finds links to a
I have a 2.0 framework ASP.Net page that runs in our controled environment (IE

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.