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

[Solved] AJAXPanel does postback & Page_Load

3 Answers 176 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 06 Jan 2008, 07:38 AM
I am trialing the prometheus with VS2008.

I have a problem with the RadAjaxPanel - it causes Page_Load and Page.IsPostback is true ... can you help.
Also : is Viewstate for entire page being sent over (eeeek) ?
Thanks.

Default.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="testAjaxPanel._Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
       
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px"
            Width="300px">
            <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
            <asp:TextBox ID="TextBox1" runat="server" />       
        </telerik:RadAjaxPanel>

    </div>
    </form>
</body>
</html>


Default.aspx.cs:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace testAjaxPanel
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                TextBox1.Text += "NOOOO";
            }

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            TextBox1.Text += "Po";
        }
    }
}

3 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 07 Jan 2008, 11:14 AM
Hi Simon,

This behavior is by design as RadAjax Prometheus preserves the whole life-cycle of the page and in order to do so it sends the whole viewstate field to the server as well.


Regards,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Simon
Top achievements
Rank 1
answered on 07 Jan 2008, 09:43 PM
So this appears to be the same as an AJAX UpdatePanel. The problem with this is that if the page has alot of controls on it this means alot of data transferred back and forth needlessly. I was hoping to find something that could be more discriminating, so that i treat portions of the page independantly without having to resort to multiple aspx pages (moving between ASPX pages causes the unsightly flicker that AJAX is trying so hard to get rid of).
0
Steve
Telerik team
answered on 08 Jan 2008, 09:00 AM
Hello Simon,

What we benefit from are the smaller chunks of html being sent back and forth and not the ViewState, which is always sent. Note that this is not "our idea" of how things should work - every ajax framework on the net works this way. Usually when there is a lot of data a significant amount of ViewState is sent to the server. You can save the roundtrip and store the ViewState in the ASP.NET session. This reduced the render size significantly and improves performance.
Generally you can look in the help of the RadControls for any specific performance optimizations. This forum thread should be a good start as well.

All the best,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Simon
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Simon
Top achievements
Rank 1
Steve
Telerik team
Share this question
or