RadAjaxPanel - Problems with Postback

5 posts, 0 answers
  1. Stanley
    Stanley avatar
    6 posts
    Member since:
    Mar 2009

    Posted 22 Dec 2009 Link to this post

    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();  
      }  


  2. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 28 Dec 2009 Link to this post

    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.
  3. Phanish m
    Phanish m avatar
    1 posts
    Member since:
    Jan 2010

    Posted 03 Jan 2010 Link to this post

    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,
  4. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 05 Jan 2010 Link to this post

    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.
  5. Stanley
    Stanley avatar
    6 posts
    Member since:
    Mar 2009

    Posted 08 Jan 2010 Link to this post

    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.
Back to Top