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

The Archive Base Latest Questions

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

The Master page got a ScriptManager. Then i got a Control with a ScriptManagerProxy

  • 0

The Master page got a ScriptManager.

Then i got a Control with a ScriptManagerProxy and an UpdatePanel.

Inside the UpdatePanel there I dynamically add a Control (also containing a ScriptManagerProxy) and from that control I need to run some JavaScript code.

DynamicControl.ascx:

<script type="text/javascript">
    function doSomething() {
        alert(1);
    }
</script>

DynamicControl.ascx.cs:

public void Page_Load(object sender, EventArgs e)
{
...
ScriptManager.RegisterStartupScript(
this.Page, this.GetType(), "scriptID",
"<script type='text/javascript'>doSomething();</script>", false);

My problem is that the function “doSomething()” is never called and i dont know why. :S
Edit: It is called but not directly when i add the control.

If I do code like this, there will be an alertwindow:

"<script type='text/javascript'>alert(1);</script>"

Ok I think i need to add some more information:

The control is dynamical added inside a jQuery Dialog. And I found out that the javacode is first executed after i close and then open the dialog. Some kind of event is triggered so that the code is executed there i think. Is it possible to force this event? so the scripts are executet directly when the control is added ?

placeHolder.Controls.Add(dynamicReportControl);

This c# code doesn’t execute the javascript tag immediately ?

  • 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-25T05:55:38+00:00Added an answer on May 25, 2026 at 5:55 am

    Please try something like this

    ScriptManager.RegisterStartupScript(
    this.UpdatePanel1, this.UpdatePanel1.GetType(), "scriptID",
    "<script type='text/javascript'>doSomething();</script>", false);
    

    Where UpdatePanel1 is your UpdatePanel

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

Sidebar

Related Questions

I've got a master page setup with a contentplaceholder control inside the title tag
I've got a project that uses a Master Page. There is also a Content
I got a master page with a server control in it. Randomly the server
I've got a small login control on my master page. On the login control,
I've got an aspx page that inherits from a master page template. Usually, I'd
there's a label control on my master page..if its value is Value1 ,I want
I have Update panel in Master page: <asp:ScriptManager id=CartScript runat=server></asp:ScriptManager> <asp:UpdatePanel id=CartBox runat=server updateMode=Conditional>
I've got a master page and a content page. How can I add controls
I've got an asp.net control inside a masterpage, so I thought the following selector
I have a master page that contains an ASP.NET server side Menu control (System.Web.UI.WebControls.Menu)

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.