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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:19:19+00:00 2026-05-26T04:19:19+00:00

I have a Control that looks like this: <telerik:RadCodeBlock runat=server> <script type=text/javascript> function refresh()

  • 0

I have a Control that looks like this:

<telerik:RadCodeBlock runat="server">
    <script type="text/javascript">
        function refresh() {
            window.$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindRecommendations");
        }
    </script>
</telerik:RadCodeBlock>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="AjaxRequest">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="NameOfGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    <Windows>
        <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="UrlOfPage" OnClientClose="refresh"></telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

Page:

<script type="text/javascript">
    function closeWindow() {
        self.close();
        return false;
    }
</script>
<!-- form fields here -->
<telerik:RadButton runat="server" ID="_cancel" Text="Cancel" OnClientClick="closeWindow"></telerik:RadButton>
<telerik:RadButton runat="server" ID="_submit" Text="Submit" OnClientClick="closeWindow" OnClick="DoSomeDataBaseStuff"></telerik:RadButton>

This works as intended. My RadWindow is removed and my control’s grid refreshes upon hitting either the cancel or submit buttons. The problem is that the database isn’t finished doing its work by that time so the grid refresh doesn’t reveal the changes. I have attempted to switch my implementation of page to look like this:

Page:

<script type="text/javascript">
    function closeWindow() {
        self.close();
        return false;
    }
</script>
<!-- form fields here -->
<telerik:RadButton runat="server" ID="_cancel" Text="Cancel" OnClick="CallJavaScriptToKillWindow"></telerik:RadButton>
<telerik:RadButton runat="server" ID="_submit" Text="Submit" OnClick="DoSomeDataBaseStuffAndThenCallJavaScriptToKillWindow"></telerik:RadButton>

Code Behind eventually calls this after database work completes:

ClientScript.RegisterStartupScript(GetType(), "Key", "closeWindow();", true);

I hit my breakpoint in the closeWindow function, but it doesn’t have the same behavior (the window doesn’t actually close). I’ve tried various iterations like:

ClientScript.RegisterStartupScript(GetType(), "Key", "$(document).ready(function() {return closeWindow();});", true);

to no avail. What am I missing?

  • 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-26T04:19:20+00:00Added an answer on May 26, 2026 at 4:19 am

    What is ‘self’? Don’t you mean ‘this’?

    Are you trying to close the RadWindow from inside the window or from the page that launches the window?

    From inside a window, I usually do this:

        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        }
    
        function Close()
        {
            var oWindow = GetRadWindow();
            oWindow.argument = null;
            oWindow.close();
            return false;
        }
    

    Also, I’d use ScriptManager.RegisterStartupScript rather than ClientScript.

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

Sidebar

Related Questions

I currently have a slider control that looks like this: <cc1:SliderExtender ID=sliderTest runat=server Enabled=True
We have some html that looks like this: <form id=MyUserControl runat=server method=post> <script language=javascript
I have a DataPager control that looks like this: <asp:DataPager ID=page1 PagedControlID=ExperienceList runat=server PageSize=3
I have a control that look something like this: <asp:DetailsView ID=dvUsers runat=server DataSourceID=odsData DataKeyNames=Id>
I have a composite control which emits HTML that looks like this <span id=myControl>
I have a control template for a button that looks like this: <ControlTemplate x:Key=CopyButton
I have a select control that looks like this: <select name=MyName id=MyID> <option value
I have a multiselect control that looks like this (sorry for the long id
I have some code on a User Control that looks like this: <asp:PlaceHolder id=ph1
I have a very simplistic user control that looks like this: <%@ Control Language=C#

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.