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

[Solved] RadAjax ajaxRequest and child iframe cause parent page postback

3 Answers 275 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 22 Feb 2008, 05:48 AM
I have a main form (frmMain.aspx)which has an iframe element, setting src="frmChild.aspx" - both forms are AJAX enabled. When I trigger a client event (eg button click) from the main form and in javascript call the ajaxRequest routine of a RadAjaxPanel on the frmChild.aspx the main form is also posted back ( a normal postback as opposed to an AJAX one).

I have managed to get rid of the main form postback by introducing another iframe into the main form with src="frmToolbar.aspx"  (which i havent AJAX enabled yet); when this frmToolbar initiates the call to the frmChild RadAjaxPanel ajaxRequest the extraneous postback is eliminated.

Is this behaviour by design (and I can rely on it functioning this way into the future)?

Thanks,

Simon

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 25 Feb 2008, 11:45 AM
Hello Simon,

Can you please check whether you are cancelling the postback from the button after initiating the ajax request? I have attached a simple page to demonstrate the requested functionality. Let me know whether this helps.

Best regards,
Rosen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Simon
Top achievements
Rank 1
answered on 26 Feb 2008, 12:16 AM
Thanks, Telerik team. I appreciate your responsiveness on my query. I will have to find a program to cope with this .rar file, however as Windows XP has no built in program for this (only .zip files). Can you link me to one that is not virus infested ?
0
Simon
Top achievements
Rank 1
answered on 26 Feb 2008, 02:08 AM
Thanks again.

Your comments re cancelling the postback are correct - the postback is nothing to do with the ajaxRequest, but merely a standard part of the asp working. Using the standard way of stopping the asp button postback works.

ie placing return in the code and ensuring the javascript function returns false:

OnClientClick="return DoAction()"
 
        function DoAction(commandName)
        {
            ...
            return false;
        }

Tags
Ajax
Asked by
Simon
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Simon
Top achievements
Rank 1
Share this question
or