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

AjaxRequest understanding issue

9 Answers 141 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 02 Oct 2008, 05:25 PM
Hi,

I think I misunderstand the usage of RadAjaxManager.AjaxRequest. My application uses a single RadAjaxManager in the masterpage and RadAjaxManagerProxies in the content pages. One of the content page contains a RadGrid which I want to rebind when a popup closes. This is what I did:

* Added the server-side delegate which rebinds the grid in the content page's Page_Load   method (RadAjaxManager.GetCurrent(Page).AjaxRequest +=new   RadAjaxControl.AjaxRequestDelegate(MyPage_AjaxRequest);)

* Created a clident-side script which performs the ajax request like this:
ajaxManager.ajaxRequest();

The problem is, that the client script is called but appearently no ajax request is performed. What's the problem here?

Best regards,
Robert

9 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 06 Oct 2008, 10:53 AM
Hi Robert,

I'm afraid that I'm not sure what may caused the behavior you are experiencing from the supplied details. Can you please provide some more information about you case and implementation and what ajax setting you are using? I have attached a simple page which demonstrates a basic implementation of similar control layout, please give it a try and let us know if this helps.

All the best,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Aleksandar
Top achievements
Rank 1
answered on 07 Oct 2008, 10:16 AM
Hi guys at Telerik,
Can you please take note of the following:
-Include VB code in your replys (I know there is a translator here, but it is not always accurate and it is easier if you do it, then if many of us using your code do that (sometimes with not much success in geting accurate translation). At least you will save us some time (see third comment),
-Please, but please, start commenting your code. Even things you consider the most trivial are very helpfull sometimes.
-Remember we buy your product to save us some time and your documentation is one of the worst on the market (I use Exeed and nsoftware as well, please compare) and many times learning (please note, not even troubleshooting) is time demanding and stressfull.
-Speed up your web site. Esspecially forums are very slow. Maybee because I am in New Zealand, but again, I am comparing you to the other component suppliers
-Stop opening new windows when going to support part of your site (Online demo -> forums). As everyone, we hate new windows when it is not us who request them.
-Give us option to see maximised window when in Demos - Control - LeftLink(FirstLok as example) -> One of the code versions (ASPX as example) -> Open in new window. I am sure that the most of us have big screens and would like to view code in full size, not to suffer with broken text in small window.
-Why are you not using Telerik Window controll for popup window? Is something wrong with it?

If you follow at least some of my commens, you will make "Telerik experience" much nicer.

Alex
0
Ivo
Telerik team
answered on 07 Oct 2008, 02:41 PM
Hello Aleksandar,

Thank you very much for the feedback. I have updated your Telerik points.

1) Point taken that we need to have VB code in the forums as well. All other places have both C# and VB (demos, documentation, support tickets- you can specify which version you use, etc)

2) We already started doing this. Please expect more coverage with comments soon.

3) Do you have any specific suggestions on how we can improve the documentation? All our product resources (demos, docs, videos, KBs, tutorials, etc) have a comprehensive coverage on all controls and features - what exactly are you missing or finding demanding and stressful?

4) We are working on a major update of the website and the new one will be much faster than before. Stay tuned for more details soon.

5) We only open new windows when you navigate outside of a website/web application into a new one.

6) We'll fix that.

7) We are using it at some places, not everywhere, though.

All the best,
Ivo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Aleksandar
Top achievements
Rank 1
answered on 08 Oct 2008, 06:44 AM
Hi Ivo,
I will try to address documentation issues in my next posts.
To start with, go to Telerik Trainer link you have in your signature, download Ajax training video and note the following issues:
-Video shows basic use only,
-It is for new users, starting with Telerik controlls now. Existing users converting to AJAX range do not benefit from it as you say nothing about the differences between use of previous and new versions,
-It is focused on drag-and-drop, which is easy to figiure out without spending half hour in watching the video.
-No focus on advanced coding, which is, very often must-to in applications more serious then "Hello World"

For example, with AJAX, I find question "How do I make it work from client side in custom web controll?" and I still havent found a propper answer explaining the following situation in VB language: Master page, page, custom client controll on the page. RadAjax and SC on Master, RadAjaxProxy in custom web control. Nothing I found so far gives complete how-to on how to get AsyncRequest event on the server in custom client control (common name for event was RadAjaxManager1_AsyncRequest with old library). I might be wrong, because you might have this sitting somewhere (please point me to if you know about it), but I spend hours in trying to find it. I found many solutions similar to that one, but no solutin was 100% right. The one you proposed in this post is not easy convertable to VB.
Regards,
Aleksandar
0
Rosen
Telerik team
answered on 09 Oct 2008, 07:37 AM
Hi Aleksandar,

We have a wide range of resources covering both basic content (for first-time users of RadControls) as well as advanced content for more complex scenarios similar to yours. Videos are usually starting from basic scenarios and we are gradually building more complex ones. We are still working on the curriculum we want to cover with our videos and you should expect more advanced episodes soon.

In your case it will be best to refer to these resources: 

    RadAjax and WebUserControls
    RadAjax and UserControls live demo example
    RadAjax and MasterPages live demo example

Also I have attached a simple implementation of the scenario in question.
In hope this helps.

Best wishes,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Aleksandar
Top achievements
Rank 1
answered on 09 Oct 2008, 09:54 AM
Hi Rosen,
-Thanks for the EXCELENT sample. If I had this 5 days ago, I would have had 5 days of joy more in my life...
-Links you pointed me to are not very helpfull. Just as example, your master page sample is without the master page listed...

I think you have many experts there, but not many educators.
Looking forward to see more practical samples similar to one you attached available on your web site.

Regards,
Alex
0
Aleksandar
Top achievements
Rank 1
answered on 09 Oct 2008, 10:18 AM
Still unsolved:
If you add the following code to Page_Load of your WebUserControl, it will trow an error. With old frameork, it was possible:
        If Not Page.IsPostBack Then  
            Dim strScript As String = "getTimeFromuserControl();" 
            ScriptManager.RegisterStartupScript(Me.Page, Page.GetType, _  
            "StartupScript", strScript, True)  
        End If 
Error:
Microsoft JScript runtime error: 'null' is null or not an object
It looks like the following:
        function getTimeFromuserControl() {  
ERROR HERE:            $find('ctl00_RadAjaxManager1').ajaxRequest("UserControl");  
        }  
 

Is this by design, or am I doing something wrong? The idea was to load webmail items n RadGrid after the page shows basic interface. Please add RadLoadingPanel to the solution.
Thanks,
Aleksandar
0
Rosen
Telerik team
answered on 10 Oct 2008, 01:39 PM
Hi Aleksandar,

The error you are getting is due to the fact that when the javascript method is called, the MS AJAX Framework is not completely loaded and the RadAjaxManager client object is not created yet. Therefore, you may use MS AJAX framework's pageLoad client-side method to execute the call to getTimeFromuserControl. Similar to the following:

Dim strScript As String = " function pageLoad(){getTimeFromuserControl();}" 
ScriptManager.RegisterStartupScript(Me.Page, Page.GetType, _  
  "StartupScript", strScript, True

Please refer to MS AJAX framework documentation for details on page's client-side lifecycle here.

Best regards,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Aleksandar
Top achievements
Rank 1
answered on 11 Oct 2008, 01:41 AM
Guys, when I buy your product, I expect to need to read your documentation only, not yours + MS Ajax documentation...
Thanks for the tip.

Alex
Tags
Ajax
Asked by
Robert
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Aleksandar
Top achievements
Rank 1
Ivo
Telerik team
Share this question
or