This is a migrated thread and some comments may be shown as answers.

Radwindow dose not free the resources

1 Answer 41 Views
Window
This is a migrated thread and some comments may be shown as answers.
Bahram
Top achievements
Rank 2
Bahram asked on 07 Feb 2012, 11:22 AM

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();

 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 09 Feb 2012, 11:45 AM
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 >>
Tags
Window
Asked by
Bahram
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Share this question
or