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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:04:48+00:00 2026-05-17T23:04:48+00:00

OK, this feels like a question that should be easy to answer, but as

  • 0

OK, this feels like a question that should be easy to answer, but as with so much mixing of asp.net and jQuery, it’s a bit of a nightmare.

What I want to do is be fading a div in and out at various times during the client’s viewing of my asp.net page; I fade it out using jQuery’s fadeTo() before triggering an UpdatePanel update (to indicate that the data there is not fresh) and I want to fade it in again once the UpdatePanel has been updated. I’ve gotten as far as updating the UpdatePanel in the codebehind, and this results in the div‘s content changing… but how do I fade the div back in again?

The way I see it, there are 2 ways; register an event handler on page load to detect when the div‘s content has been changed and fade it back in, or call a function from the asp.net codebehind when I’ve updated the div to fade it back in.

In the first case, there doesn’t seem to be any event triggered by the div‘s content changing, so I can’t seem to do that. If anyone knows how I could get a client event to trigger when I update the div, that would be a nice solution.

In the second case, I thought that this was what ClientScriptManager was for, but it doesn’t quite do what I want. I want to be able to register a particular Javascript function with ClientScriptManager and then tell ClientScriptManager to execute it in the client, from my codebehind. You can’t seem to do that. ClientScriptManager.RegisterClientScriptBlock() simply inserts some <script> into the HTML output, rather than calling a function. Presumably this would work if I kept registering things like:

<script>fadeBackIn();</script>

because the Javascript would be immediately evaluated and run, but this feels messy, and that feeling is intensified by the fact that I’d have to keep randomly generating a new unique value for the key argument of ClientScriptManager.RegisterClientScriptBlock(), because it’s specifically designed to stop this kind of repeated code. However, I’m struggling to see an alternative. Can anyone come up with a good idea as to a better mechanism to get this to work?

I’d really like something along the lines of:

ClientScriptManager.RegisterClientScriptFunction("fadeBackIn", "function fadeBackIn(){ ... }");

[...]

ClientScriptManager.ExecuteClientScriptFunction("fadeBackIn");

but I don’t see that functionality available. 🙁

  • 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-17T23:04:48+00:00Added an answer on May 17, 2026 at 11:04 pm

    You can attach to the page loaded event. The pageLoaded handler recieves an argument of type PageLoadedEventArgs which contains a get_panelsUpdated method that you can call to enumerate all the UpdatePanels whose content was just updated.

    Example:

    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_pageLoaded(pageLoaded);
    
    function pageLoaded(sender, args) 
    {
        var panels = args.get_panelsUpdated();
    
        if (panels.length > 0) 
        {
            for (var i in panels) 
            {
                if (panels[i].id == "DesiredUpdatePanelId") 
                {
                    fadeBackIn(); 
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question that really feels like I should have an easy answer
This feels like it should be pretty simple, but not much seems to be
This feels like a very dumb question that should be obvious to me. ;)
I feel like this should be an easy question, but I can't get it
I feel like this should be an easy question but I can't seem to
OK, this feels like an idiot question, but I'm stuck - I don't know
This feels like a really basic question, but I can't figure it out anyway..
This feels like the kind of code that only fails in-situ, but I will
I feel like the answer to this question is really simple, but I really
This feels like a super newb question, so apologizes in advance. How does one

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.