Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Window > Radwindow dose not free the resources

Not answered Radwindow dose not free the resources

Feed from this thread
  • Bahram avatar

    Posted on Feb 7, 2012 (permalink)

    Hello everybody,

    I am using a radwindow  that will be opened from my radGrid through some JavaScript code,

    <script type="text/javascript">

                function ShowEditForm(id, rowIndex) {

                    var grid = $find("<%= RadGrid1.ClientID %>");

     

                    var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();

                    grid.get_masterTableView().selectItem(rowControl, true);

     

                    window.radopen("EditFormCS.aspx?PanelId=" + id, "UserListDialog");

                    return false;

                }

                function ShowInsertForm() {

                    window.radopen("EditFormCS.aspx", "UserListDialog");

                    return false;

                }

                function refreshGrid(arg) {

                    if (!arg) {

                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");

                    }

                    else {

                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");

                    }

                }

                function RowDblClick(sender, eventArgs) {

                    window.radopen("EditFormCS.aspx?PanelId=" + eventArgs.getDataKeyValue("PanelId"), "UserListDialog");

                }

            </script>

     

    After a while it enconcuter an error when I am trying to open the radwindow, and it seems that it never free the resources(memory)  after I close

    the radwindow.I have read so many posts and none  of them come to solve the problem.

    For   instance I used Garbage collector to free the resource but it dosnt work.I restart

     The Server(Immagin how terrible is  it when so many Users are connected )and it is ok until it take whole the memory again.

    The structur is :

    Myfolder :

                    myPage(RaddGrid is in this page and radwindow will be opened  through a link insid the Grid)

                    EditForm(content of radwinow)

     

    And in EditForm after user Submit  it will close the radwindow

    <script type="text/javascript">

                function CloseAndRebind(args) {

                    GetRadWindow().BrowserWindow.refreshGrid(args);

                    GetRadWindow().close();

                }

     

                function GetRadWindow() {

                    var oWindow = null;

                    if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog

                    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)

     

                    return oWindow;

                }

     

                function CancelEdit() {

                    GetRadWindow().close();

                }

                function onError(input, args) {

                    var message = "Invalid character: ";

     

                    message += "accepts only numberic values.";

                    document.getElementById("numInput").innerHTML = args.get_inputText();

                    document.getElementById("numErrorOut").innerHTML = message;

                }

                function onKeyPress(input, args) {

     

                    document.getElementById("numInput").innerHTML = "";

                    document.getElementById("numErrorOut").innerHTML = "";

     

                }

                function Close() {

                    GetRadWindow().Close();

                }

            </script>

    And my GC is in the submit event :

      GC.Collect();

            GC.WaitForPendingFinalizers();

            GC.Collect();

     

    Reply

  • Marin Bratanov Marin Bratanov admin's avatar

    Posted on Feb 9, 2012 (permalink)

    Hello Bahram,

    The RadWindow is entirely a client-side object and does not take resources on the server. An issue you may be experiencing is rather related to the code in your page and their performance or some setting in your server. Using the RadWindow to load your pages is equivalent to opening them in a regular iframe or browser popup - from the server point of view the page is requested, compiled, and send to the client in all cases.

    What I can suggest is that you review your pages in the light of the information you can find in this help article and the resources it links on matters with the RadControls. You can also search the net for general performance optimization tips like making sure that debug is set to false in the compilation section of the web.config.


    Kind regards,
    Marin
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Window > Radwindow dose not free the resources
Related resources for "Radwindow dose not free the resources"

ASP.NET Window Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]