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

[Solved] Loading from code behind error.

4 Answers 333 Views
Window
This is a migrated thread and some comments may be shown as answers.
franchute
Top achievements
Rank 1
franchute asked on 03 Mar 2008, 01:34 PM
Hi guys,

I have the following situation. I`m loading a radwindow which has a formview within it.
The formview has some textboxes and a delete button at the bottom of the page and is wrapped by a RadAjaxPanel. Once I click the delete button, I'm opening a radconfirm control which ask me whether to delete the current item or not.
If I click "yes" and for some reason, the system is not able to delete it, then I'm loading the status error by codebehind using this line of code:

ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);

However, I'm getting the following javascript error:

    "this._windows.length is nul or not an object"

If I remove the ajax panel, then I'm getting an "undefined" error in the following line (from the ScriptResource.axd)

        var _6=_5._getStandardPopup("alert",_1);

Do you have any idea what's going on here ?

Thanks in advance.
François.


4 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 04 Mar 2008, 03:55 PM
Hello François,

This error occurs because you are trying to call radalert before the RadWindowManager is loaded on your page. When you have a AJAXEnabledWebSite, the page lifecycle is different and the MS AJAX based controls (as RadWindowManager) are loaded after all other controls. Therefore you must add a load handler and call the radalert there. In order to implement this you must modify your script in the following manner:

string scriptstring = "Sys.Application.add_load(function(){radalert('RADALERT CALLED');});";  
ScriptManager.RegisterStartupScript(this, GetType(), "radalert", scriptstring, true); 
 

If you still experience problems, please open a support ticket and send us a small sample project which reproduces them - we will check it right away.



Greetings,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
franchute
Top achievements
Rank 1
answered on 04 Mar 2008, 04:38 PM
Thank you Svetlina,

I have proved the steps you described below but the issue I found this time was that  the the page is showing the radalert, not only the first time it should show it, but also in all successives callbacks (after the first time radalert is showed).

Any idea ?
I will create an example so you can find what's going on.

Thanks again,

François

0
Svetlina Anati
Telerik team
answered on 05 Mar 2008, 11:51 AM
Hi François,


I am not quite sure what is your exact setup, but I would recommend to make sure that the above mentioned code is executed only when you want to call the radalert dialog.

If you still experience problems, please open a new support ticket and send us a sample application along with more detailed information about the desired behavior. We will check it and do our best to help.



All the best,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
creatif
Top achievements
Rank 2
answered on 23 Apr 2008, 08:26 PM
I'm not sure if this will help in your exact scenario, but I had an identical issue.

I noticed I had declared my RadWindowManager inside a RadAjaxPanel ... every ajaxified postback thus disabled calling out to radconfirm from a control on the page. Once I moved the window manager outside of the ajaxpanel, the errors went away and all worked as expected.
Tags
Window
Asked by
franchute
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
franchute
Top achievements
Rank 1
creatif
Top achievements
Rank 2
Share this question
or