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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:34:36+00:00 2026-05-22T21:34:36+00:00

well. The problem i’m facing is i have my own custom control and i

  • 0

well. The problem i’m facing is i have my own custom control and i do a query , get records and dynamically add html controls to the page based on the data.

Now there’s the problem of adding some dynamic javascript

I do this with the help of literal controls.

<asp:Literal runat="server" ID="latEventToolTipJqueryScripts"></asp:Literal>

This works like a charm

<script language="javascript" type="text/javascript">
// <![CDATA[
    Sys.Application.add_load(WireEvents_<%=this.ID%>); // fix wiring for .NET ajax updatepanel
    $(WireEvents_<%=this.ID%>); // handle page load wiring

    function WireEvents_<%=this.ID%>() {
        <asp:Literal runat="server" ID="latEventToolTipJqueryScripts"></asp:Literal>
    }

// ]]>
</script>

I add the literal text dynamically from code behind.

However, when placing the control in an updatepanel, the postbacks don’t update the script.

EDIT: The Sys.Application.add_load rewires the necessary functions just fine with the updatepanel. The problem is that the script that needs to be in place of the literal, doesn’t update when in an updatepanel.

I’ve tried the ClientScript.RegisterStartupScript but it has the same effect as with the literal control trick. Any help?

—————————SOLVED (tnx to Pranay Rana)———————————-

Got rid of the literal in the ascx side. as well as the Sys.Application.add_load

now it’s only in the code behind. The thing that was throwing me off was the JQuery thing.

this.strBuilderJS.Append( "<script language='javascript' type='text/javascript'>" +
                                "$(WireEvents_" + this.ID + ");" + 
                                "function WireEvents_" + this.ID + "(){"+
                                "    alert('stuff');");

this.strBuilderJS.Append(       "}</script>");

and then

ScriptManager.RegisterStartupScript(this, this.GetType(), "strBuilderJS", strBuilderJS.ToString(), false);
  • 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-22T21:34:37+00:00Added an answer on May 22, 2026 at 9:34 pm

    Make use of ScriptManager.RegisterStartupScript() to register your script…may resolve problem …

    Check this resolve your problem : Add JavaScript programmatically using RegisterStartupScript during an Asynchronous postback

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

Sidebar

Related Questions

Well here's my problem I have three tables; regions, countries, states. Countries can be
well this is my problem i use 2 source first query (select * from
well i have most probably an extremly stupid problem but could not figure it
Well, I have a really small problem. How can I access an ASP.NET Drop
Well the problem here is that if you have one DataTemplate for a type
I hope i described the problem well!? You can see it here: http://dealmob.de/index_dev.html when
I have a mysql table with over 4 million of data; well the problem
Well the problem I am facing right now is a size issue problem. I
well the problem is that i am trying to get DDL to: 1. Recive
Well my problem is the following. I have a piece of code that runs

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.