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

RadAjaxPanel - Problems with Postback

4 Answers 254 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Stanley
Top achievements
Rank 1
Stanley asked on 22 Dec 2009, 06:52 PM

I seem to be having a problem when I have a RadAjaxPanel that contains a submit button. Whenever that submit button is click, Page_load gets fired twice. First time around IsPostBack is false, then it gets call the second time around where IsPostBack is true. When I took that button outside of the RadAjaxPanel, then IsPostBack is working properly.

In otherwords, i need to have a way of differentiating if it's a Ajax Request.
Please advice.

In my aspx page, i have the following sample:-

<telerik:RadAjaxPanel runat="server" ID="RadTestPanel" Width="100%">  
<asp:Button ID="btnTest" runat="server" Text="Add" Font-Names="Calibri" 
                                                            Width="60px" OnClick="btnTest_Click" /> 
</telerik:RadAjaxPanel> 

Now in my code behind i have the following...
protected override void Page_Load(object sender, EventArgs e)  
{  
  if (!this.IsPostBack) //Problem lies here such that it's always false when click within the RadAjaxPanel and get's called twice. Why is that?  
  {  
    DoSomeFirstTimeInitialization();  
  }  


4 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 28 Dec 2009, 01:21 PM
Hello Stanley,

I am afraid I am unable to reproduce the described issue.
Please take a look at the sample project I used for testing and let me know if there are any differences in your scenario, which I may be leaving out.

Kind regards,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Phanish m
Top achievements
Rank 1
answered on 03 Jan 2010, 10:30 PM
Hello,

  I am placing a user control in an Telerik:Ajaxpanel and usin RegisterStartupscript to Register javascript function.
 The Javascript alert method is not getting fired on serverside buttonclick. User Control is in aspx page.

 I got to know that by placing EnableOutsideScripts="true" in AjaxPanel it works. But the Property is not supported in latest release of
 <telerik:AjaxPanel> which was there in <rad:radajaxpanel>

 Any suggestions.

Thanks,
0
Mira
Telerik team
answered on 05 Jan 2010, 07:43 AM
Hello Stanley,

I have followed your scenario and prepared a sample project implementing the desired functionality.
Please take a look at it and tell me whether you find it useful.

The EnableOutsideScripts property has been removed from the RadControls for ASP.NET AJAX as now the outside scripts are evaluated automatically after ajax request.

Best wishes,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Stanley
Top achievements
Rank 1
answered on 08 Jan 2010, 03:28 PM
I have found out the culprit. Somehow in one of my basepage where I do registerJavaScript, it's appending to javascript postback calls.
It's a bug on my end. Thanks to all that have responsed.
Tags
Ajax
Asked by
Stanley
Top achievements
Rank 1
Answers by
Mira
Telerik team
Phanish m
Top achievements
Rank 1
Stanley
Top achievements
Rank 1
Share this question
or