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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:25:03+00:00 2026-06-17T08:25:03+00:00

I am registering java script to my Asp.net code behind file, which is working

  • 0

I am registering java script to my Asp.net code behind file, which is working fine. Now, I have some update panels on the same page and problem is whenever there is any change in any of the update panel, this script is automatically getting called. Is there any way that I can stop this happening. I can’t remove update panels from my page and this script is also a very essential part of the application. In this situation I am just calling a alert (rad alert with set time out functionality) when Save Button is clicked or an Update routine is called while I have few other buttons in update panels and whenver any of the button which is registered to the update panels clicked, the following script is called un-willingly. Anyone’s help will really be appreciated.

following is my Page.ClientScript

                string radalertscript = "<script language='javascript'> Sys.Application.add_load(function(sender, e) {var oWnd = radalert('dialogMessage', 400, 140, 'Saved');window.setTimeout(function () { oWnd.Close(); }, 3000);});</script>";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", radalertscript);
  • 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-17T08:25:04+00:00Added an answer on June 17, 2026 at 8:25 am

    You can assign empty string to same key radalert to remove the script.

    if(some_condition)
        Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", "");
    

    Edit: Based on comments, you can make it simple without using RegisterStartupScript

    In code behind

    btnSave.Attributes.Add("", "saveButtonFunction();");
    

    In Javascript

    <script language='javascript'>
    
       Sys.Application.add_load(function(sender, e) {
               if(btnSaveClicked){
                  var oWnd = radalert('dialogMessage', 400,140, 'Saved');
                  window.setTimeout(function () { oWnd.Close(); }, 3000);
                  btnSaveClicked = false;
               }
        });
    
        btnSaveClicked = false;
        function saveButtonFunction(){
           btnSaveClicked = true;
        };    
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In case we are registering a java script inside the Server side code using
If I'm registering events on a UserControl in the code behind. E.g.: public partial
ASP.NET 2.0 provides the ClientScript.RegisterClientScriptBlock() method for registering JavaScript in an ASP.NET Page. The
I have an ASP.NET page with two instances of the same Web User Control
In my application i have to export the excel file which I have achieved
I'm registering a javascript in aspx.net Dim script = <script language = javascript> &
I am using Java 7, java.nio.file.WatchEvent along with the WatchService . After registering, when
I copy this code to create my first program with maps in java script
I am using one master page.In that I am registering java scripts and checking
For instance by registering as a receiver of some intent. I realize that the

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.