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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:38:03+00:00 2026-05-24T23:38:03+00:00

stuck on a problem to do with registering and then unregistering a block of

  • 0

stuck on a problem to do with registering and then unregistering a block of javascript code. How can I unregister GRIDqrarefreshexposurereport?

  1. The below code will show a radio button list when the datasource of my grid is null.
  2. Upon Selection, the page will refresh, the datasource and grid will be populated and the radio button list will be hidden due to GRIDqrarefreshexposurereport.

  3. Upon clicking a cancel button, the datasource is set to null, the page is reloaded, the grid is empty and the radio button lists never appear even though they should.

Have debugged the code, and it runs through the correct blocks of code, however when I look at the source code of my ASP.net page both blocks of javascript are present, with the GRIDqrarefreshexposurereport block appearing last which is why i think the radio button list is not reappearing.

If anything is unclear I’ll do my best to clarify, any tips on how to make this clearer gladly taken.

if (gridExposureList.DataSource == null)
{
    ClientScript.RegisterStartupScript(this.GetType(), "qrarefreshexposurereport",                                  // Framework 2.0 conversion
            @"<script language=""javascript"" type=""text/javascript"">
                        document.getElementById(""NoFilter"").style.display = ""None"";
                        document.getElementById(""RefreshEventsSummaryTiming"").style.display = ""none"";
                        document.getElementById(""RefreshEventsSummaryXPOS"").style.display = ""none"";
                        document.getElementById(""RefreshEventsSummaryFilter"").style.display = """";
                        document.getElementById(""QRAList"").style.display = ""none"";
        document.getElementById(""RefreshExpRepFilter"").style.display = """";
        document.getElementById(""GridButtons"").style.display = ""none"";
                        </script>
                        ");
}
else
{
    ClientScript.RegisterStartupScript(this.GetType(), "GRIDqrarefreshexposurereport",                                  // Framework 2.0 conversion
        @"<script language=""javascript"" type=""text/javascript"">
                    document.getElementById(""NoFilter"").style.display = ""None"";
                    document.getElementById(""RefreshEventsSummaryTiming"").style.display = ""none"";
                    document.getElementById(""RefreshEventsSummaryXPOS"").style.display = ""none"";
                    document.getElementById(""RefreshEventsSummaryFilter"").style.display = """";
                    document.getElementById(""QRAList"").style.display = ""none"";
    document.getElementById(""RefreshExpRepFilter"").style.display = ""none"";
    document.getElementById(""GridButtons"").style.display = """";
                    </script>
                    ");
}
  • 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-24T23:38:04+00:00Added an answer on May 24, 2026 at 11:38 pm

    Since ClientScript.RegisterStartupScript method registers code block on every post back, there doesn’t seem any need to have unregister/deregister script block method. If you don’t want any code block to be registered, then just don’t register it.

    Just a guess, that the above code you pasted exists inside Page_Load method, if it is then it makes sense why you are having this problem, when post back occurs for setting gridExposureList.DataSource to null, Page_Load method is executed first and since gridExposureList.DataSource isn’t null yet it registers GRIDqrarefreshexposurereport and then calls the event for which the post back actually occurred… What you can do is, skip the above code in case of a post back and inside the event that set the database source of your gird to null, add the code to register the correct script block.

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

Sidebar

Related Questions

I'm stuck on a RegEx problem that's seemingly very simple and yet I can't
I am stuck on this problem which I am studying for an exam tomorrow.
Im working on an ASP.Net app with c#. I am stuck on a problem
Really stuck on trying to write code to unzip a file or directory on
I am stuck with a problem which seems stupid but I cannot find out
I am stuck with a problem when testing my controllers with RSpec - the
I'm stuck on a problem for hours now and having read everything about this
I am stuck with a problem concerning JPA-2.0 queries with relationships. How would it
I am currently stuck with this problem of displaying an image using HtmlHelper class.
I'm kind of stuck on a problem of how to stop my menu from

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.