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

  • Home
  • SEARCH
  • 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 8692427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:18:41+00:00 2026-06-13T00:18:41+00:00

When the page initially renders, the initializeControl function is called and everything works. When

  • 0

When the page initially renders, the initializeControl function is called and everything works.

When the page performs a full post-back (via a submit button), the initializeControl function is also called and everything works.

When there is partial post-back of the UpdatePanel, though, the initializeControl function is never called and the control stops working.

HTML:

<asp:ScriptManager ID="myScriptManager" runat="server" />
<asp:UpdatePanel ID="myUpdatePanel" runat="server">
    <ContentTemplate>
        <uc:MyControl ID="myControl" runat="server" />
    </ContentTemplate>
</asp:UpdatePanel>

User Control:

Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
    Dim initializeScript = String.Format("initializeControl('{0}');", ClientID)

    Page.ClientScript.RegisterStartupScript(GetType(Page),
        New Guid().ToString(), initializeScript, True)

    MyBase.Render(writer)
End Sub

For testing purposes, assume the initializeControl function is just a debugger; (the content of the function works fine – it’s just not being called when it needs to be).

Please keep in mind that there is no way (that I know of) for the user control to know if it is inside an UpdatePanel or not, and there is also no way it can access the ScriptManager element on the parent page in server code.

Thanks in advance.

P.S. I know UpdatePanels are awful and should be avoided at all costs, but I am working with hundreds of consuming pages that are already using them and they can not be changed.

  • 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-13T00:18:42+00:00Added an answer on June 13, 2026 at 12:18 am

    It’s most likely due to the fact that the page update is happening through the update panel. Startup scripts can have issues with not firing in these cases, and need to be wrapped in:

    Sys.Application.add_load(function(){ myFunctionCall(); });
    

    It’s the Microsoft AJAX library’s way of ensuring your startup script happens when it should during MS AJAX roundtrips.

    Here’s an easy way to ensure all client scripts added to the page work, regardless of whether they are contained in an ajax updatepanel or not. We use this in all of our projects and it works flawlessly:

    ASP.Net – Javascript inside AJAX UpdatePanel

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

Sidebar

Related Questions

Initially I ran rails g scaffold Post title:string content:text and after migrating everything worked
Initially i was planning to use master page for every page in my application.
I have a page with a list of items initially loaded from a include_once('show_calendarV2.php');
I have a page where I am loading bunch of images initially when the
I have an iframe on a page that I need to initially have a
I have a page that has 4 tables. Initially when the page is loaded,
I am using jcarousel on a page in 3 different sections. I initially show
I am working on a GridView in Asp.Net. When initially a the Page Loads,
I have dataTable in my page. Initially I want it to be hidden, and
I have a complex ICEFaces XHTML page that renders certain components conditionally, based on

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.