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

Adding OnRequestStart OnRequestEnd in Dynamic User Controls

1 Answer 91 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Axe
Top achievements
Rank 1
Axe asked on 15 Aug 2008, 03:25 PM

I have an aspx page which dynamically loads user controls via client ajax call (.ajaxRequest(argument)). On one of the user controls in an upload control which needs full postback. I can successfully add client function to kill ajax request from user control for full postback and everything works as expected however once you load another control I get javascript error. I tried ways of removing the function on other pages, well actually the server side event AjaxRequest on aspx page.
As a work around I have to add the OnRequestStart & OnResponseEnd on the aspx page and check which page and only cancel ajax if that page and it works fine but is there a better way?

function
Request(sender, args)
{
    //alert('Request start initiated by: ' + args.get_eventTarget());
    if (args.get_eventTarget() == "ControlsAddTrackControl$btnTrkFleUload")
    {
        args.set_enableAjax(
false);
    }
}

Regards

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 15 Aug 2008, 03:47 PM
Hello Axe,


By default the AJAX Panel ajaxifies all controls placed inside. If you want to exclude a control from ajaxifying you can use one of the following approaches: Exclude controls from ajaxifying

All the best,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Axe
Top achievements
Rank 1
Answers by
Missing User
Share this question
or