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

[Solved] Prometheus RadAjaxPanel causes full postback

4 Answers 216 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 23 Apr 2008, 12:00 PM
Hi

I've just updated an application to the new Prometheus release and have a problem.

I have a FormView containing a RadAjaxPanel. The first time I cause an event that should cause a callback, I get a full page postback and refresh.

When the page reloads, the css class applied to the RadAjaxPanel no longer seems to be in effect.

But subsequent events cause an Ajax callback as expected rather than the full postback that occurs the first time.

This problem didn't occur with the "classic" RadAjax.

I've attached the markup of the FormView below:

<asp:FormView ID="fvPage" runat="server" DefaultMode="Insert" DataSourceID="sdsForm" DataKeyNames="PageCode" OnDataBound="fvPage_DataBound" OnItemInserted="fvPage_ItemInserted" OnItemInserting="fvPage_ItemInserting" OnItemUpdated="fvPage_ItemUpdated" OnItemUpdating="fvPage_ItemUpdating">  
    <InsertItemTemplate> 
        <asp:ValidationSummary ID="vs1" runat="server" ForeColor="" CssClass="errorpanel" DisplayMode="List" EnableClientScript="true" ValidationGroup="Page" /> 
        <div id="formcontainer">  
            <rad:RadAjaxPanel ID="rap1" runat="server" EnablePageHeadUpdate="False" LoadingPanelID="alp1" CssClass="zerodiv">  
                <sam:FormLabel ID="flblSection" runat="server" ControlToLabel="ddlSection" Text="Website Section" ToolTip="Website Section" /><asp:DropDownList ID="ddlSection" runat="server" CssClass="forminputwider" TabIndex='<%# this.TabIndex %>' DataSourceID="sdsSection" DataTextField="SectionName" DataValueField="Code" AppendDataBoundItems="true" OnSelectedIndexChanged="CreateUniqueUrl" AutoPostBack="true" SelectedValue='<%# Bind("SectionCode") %>'><asp:ListItem Value="" Text="(Site Root)" /></asp:DropDownList><br class="clear" /> 
                <sam:FormLabel ID="flblPageName" runat="server" ControlToLabel="txtPageName" Text="Descriptive Page Name" ToolTip="Descriptive Page Name" /><asp:TextBox ID="txtPageName" runat="server" Text='<%# Bind("PageName") %>' ToolTip="Descriptive Page Name" TabIndex='<%# this.TabIndex %>' MaxLength="100" CssClass="forminputwider" OnTextChanged="CreateUniqueUrl" AutoPostBack="true" /><asp:RequiredFieldValidator ID="rfvPageName" ControlToValidate="txtPageName" ErrorMessage="Please enter a descriptive page name" ForeColor="" Display="None" ValidationGroup="Page" runat="server" /><br class="clear" /> 
                <sam:FormLabel ID="flblPageURL" runat="server" ControlToLabel="txtPageURL" Text="Page URL" ToolTip="Page URL" /><asp:TextBox ID="txtPageURL" runat="server" Text='<%# Bind("PageURL") %>' ToolTip="Page URL" TabIndex='<%# this.TabIndex %>' MaxLength="100" CssClass="forminputwider" Enabled="false" /><asp:RequiredFieldValidator ID="rfvPageURL" ControlToValidate="txtPageURL" ErrorMessage="A URL must be provided" ForeColor="" Display="None" ValidationGroup="Page" runat="server" /><br class="clear" /> 
            </rad:RadAjaxPanel> 
              
            <sam:FormLabel ID="flblBrowserTitle" runat="server" ControlToLabel="txtBrowserTitle" Text="Browser Title" ToolTip="Browser Title" /><asp:TextBox ID="txtBrowserTitle" runat="server" Text='<%# Bind("BrowserTitle") %>' CssClass="forminputwider" TabIndex='<%# this.TabIndex %>' MaxLength="250" /><asp:RequiredFieldValidator ID="rfvBrowserTitle" ControlToValidate="txtBrowserTitle" ErrorMessage="Please enter the text to appear in the browser title bar" ForeColor="" Display="None" ValidationGroup="Page" runat="server" /><br class="clear" /> 
            <sam:FormLabel ID="flblMetaKeywords" runat="server" ControlToLabel="txtMetaKeywords" Text="Meta Keywords" ToolTip="Meta Keywords" /><sam:SamTextBox ID="txtMetaKeywords" runat="server" Text='<%# Bind("MetaKeywords") %>' ToolTip="Meta Keywords" TabIndex='<%# this.TabIndex %>' MaxLength="250" TextMode="MultiLine" CssClass="forminputwider" /><br class="clear" /> 
            <sam:FormLabel ID="flblMetaDescription" runat="server" ControlToLabel="txtMetaDescription" Text="Meta Description" ToolTip="Meta Description" /><sam:SamTextBox ID="txtMetaDescription" runat="server" Text='<%# Bind("MetaDescription") %>' ToolTip="Meta Description" TabIndex='<%# this.TabIndex %>' MaxLength="250" TextMode="MultiLine" CssClass="forminputwider" /><br class="clear" /> 
            <div>Page Content</div> 
            <rad:RadEditor ID="rePageContent" runat="server" Skin="Telerik" ToolsFile="~/config/ToolsFile_PageEditor.xml" NewLineBr="false">  
                <CssFiles> 
                    <rad:EditorCssFile Value="~/styles/editor.css" /> 
                </CssFiles> 
                <ImageManager ViewPaths="~/uploads" UploadPaths="~/uploads" DeletePaths="~/uploads" SearchPatterns="*.jpg,*.gif,*.png" /> 
                <DocumentManager ViewPaths="~/uploads" UploadPaths="~/uploads" DeletePaths="~/uploads" SearchPatterns="*.txt,*.doc*,*.pdf" /> 
                <FlashManager ViewPaths="~/uploads" UploadPaths="~/uploads" DeletePaths="~/uploads" SearchPatterns="*.swf" /> 
            </rad:RadEditor> 
        </div> 
        <div id="formcontrol">  
            <asp:ImageButton ID="btnSave" ImageUrl="images/btn-save.png" ToolTip="Save" CommandName="Insert" CausesValidation="true" ValidationGroup="Page" TabIndex="<%# this.TabIndex %>" runat="server" /> 
            <asp:ImageButton ID="btnCancel" ImageUrl="images/btn-cancel.png" ToolTip="Cancel" CommandName="Cancel" OnClientClick="CancelEdit(); return false;" CausesValidation="false" TabIndex="<%# this.TabIndex %>" runat="server" /> 
        </div> 
        <rad:RadAjaxLoadingPanel ID="alp1" runat="server" Transparency="30" BackColor="#E0E0E0" BorderColor="#CCCCCC" MinDisplayTime="1500">  
            <asp:Image ID="imgLoading1" ImageUrl="~/RadControls/Skins/Samarind/Grid/loading.gif" BorderWidth="0px" AlternateText="Loading" runat="server" Style="margin-top: 10px;" /> 
        </rad:RadAjaxLoadingPanel> 
    </InsertItemTemplate> 
      
    <EditItemTemplate> 
        <asp:ValidationSummary ID="vs1" runat="server" ForeColor="" CssClass="errorpanel" DisplayMode="List" EnableClientScript="true" ValidationGroup="Page" /> 
        <asp:HiddenField ID="hfPageCode" Value='<%# Bind("PageCode") %>' runat="server" /> 
        <div id="formcontainer">  
            <rad:RadAjaxPanel ID="rap1" runat="server" LoadingPanelID="alp1" CssClass="zerodiv" EnablePageHeadUpdate="false">  
                <sam:FormLabel ID="flblSection" runat="server" ControlToLabel="ddlSection" Text="Website Section" ToolTip="Website Section" /><asp:DropDownList ID="ddlSection" runat="server" CssClass="forminputwider" TabIndex='<%# this.TabIndex %>' DataSourceID="sdsSection" DataTextField="SectionName" DataValueField="Code" AppendDataBoundItems="true" OnSelectedIndexChanged="CreateUniqueUrl" AutoPostBack="true" SelectedValue='<%# Bind("SectionCode") %>'><asp:ListItem Value="" Text="(Site Root)" /></asp:DropDownList><br class="clear" /> 
                <sam:FormLabel ID="flblPageName" runat="server" ControlToLabel="txtPageName" Text="Descriptive Page Name" ToolTip="Descriptive Page Name" /><asp:TextBox ID="txtPageName" runat="server" Text='<%# Bind("PageName") %>' ToolTip="Descriptive Page Name" TabIndex='<%# this.TabIndex %>' MaxLength="100" CssClass="forminputwider" OnTextChanged="CreateUniqueUrl" AutoPostBack="true" /><asp:RequiredFieldValidator ID="rfvPageName" ControlToValidate="txtPageName" ErrorMessage="Please enter a descriptive page name" ForeColor="" Display="None" ValidationGroup="Page" runat="server" /><br class="clear" /> 
                <sam:FormLabel ID="flblPageURL" runat="server" ControlToLabel="txtPageURL" Text="Page URL" ToolTip="Page URL" /><asp:TextBox ID="txtPageURL" runat="server" Text='<%# Bind("PageURL") %>' ToolTip="Page URL" TabIndex='<%# this.TabIndex %>' MaxLength="100" CssClass="forminputwider" Enabled="false" /><asp:RequiredFieldValidator ID="rfvPageURL" ControlToValidate="txtPageURL" ErrorMessage="A URL must be provided" ForeColor="" Display="None" ValidationGroup="Page" runat="server" /><br class="clear" /> 
            </rad:RadAjaxPanel> 
            <sam:FormLabel ID="flblBrowserTitle" runat="server" ControlToLabel="txtBrowserTitle" Text="Browser Title" ToolTip="Browser Title" /><asp:TextBox ID="txtBrowserTitle" runat="server" Text='<%# Bind("BrowserTitle") %>' CssClass="forminputwider" TabIndex='<%# this.TabIndex %>' MaxLength="250" /><asp:RequiredFieldValidator ID="rfvBrowserTitle" ControlToValidate="txtBrowserTitle" ErrorMessage="Please enter the text to appear in the browser title bar" ForeColor="" Display="None" ValidationGroup="Page" runat="server" /><br class="clear" /> 
            <sam:FormLabel ID="flblMetaKeywords" runat="server" ControlToLabel="txtMetaKeywords" Text="Meta Keywords" ToolTip="Meta Keywords" /><sam:SamTextBox ID="txtMetaKeywords" runat="server" Text='<%# Bind("MetaKeywords") %>' ToolTip="Meta Keywords" TabIndex='<%# this.TabIndex %>' MaxLength="250" TextMode="MultiLine" CssClass="forminputwider" /><br class="clear" /> 
            <sam:FormLabel ID="flblMetaDescription" runat="server" ControlToLabel="txtMetaDescription" Text="Meta Description" ToolTip="Meta Description" /><sam:SamTextBox ID="txtMetaDescription" runat="server" Text='<%# Bind("MetaDescription") %>' ToolTip="Meta Description" TabIndex='<%# this.TabIndex %>' MaxLength="250" TextMode="MultiLine" CssClass="forminputwider" /><br class="clear" /> 
            <asp:Panel ID="pnlPageContent" runat="server" CssClass="zerodiv">  
                <div>Page Content</div> 
                <rad:RadEditor ID="rePageContent" runat="server" Skin="Telerik" ToolsFile="~/config/ToolsFile_PageEditor.xml" NewLineBr="false">  
                    <CssFiles> 
                        <rad:EditorCssFile Value="~/styles/editor.css" /> 
                    </CssFiles> 
                    <ImageManager ViewPaths="~/uploads" UploadPaths="~/uploads" DeletePaths="~/uploads" SearchPatterns="*.jpg,*.gif,*.png" /> 
                    <DocumentManager ViewPaths="~/uploads" UploadPaths="~/uploads" DeletePaths="~/uploads" SearchPatterns="*.txt,*.doc*,*.pdf" /> 
                    <FlashManager ViewPaths="~/uploads" UploadPaths="~/uploads" DeletePaths="~/uploads" SearchPatterns="*.swf" /> 
                </rad:RadEditor> 
            </asp:Panel> 
        </div> 
        <div id="formcontrol">  
            <asp:ImageButton ID="btnSave" ImageUrl="images/btn-save.png" ToolTip="Save" CommandName="Update" CausesValidation="true" ValidationGroup="Page" TabIndex="<%# this.TabIndex %>" runat="server" /> 
            <asp:ImageButton ID="btnCancel" ImageUrl="images/btn-cancel.png" ToolTip="Cancel" CommandName="Cancel" OnClientClick="CancelEdit(); return false;" CausesValidation="false" TabIndex="<%# this.TabIndex %>" runat="server" /> 
        </div> 
        <rad:RadAjaxLoadingPanel ID="alp1" runat="server" Transparency="30" BackColor="#E0E0E0" BorderColor="#CCCCCC" MinDisplayTime="1500">  
            <asp:Image ID="imgLoading1" ImageUrl="~/RadControls/Skins/Samarind/Grid/loading.gif" BorderWidth="0px" AlternateText="Loading" runat="server" Style="margin-top: 10px;" /> 
        </rad:RadAjaxLoadingPanel> 
    </EditItemTemplate> 
</asp:FormView> 

Thanks for any advice!

Matt

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 23 Apr 2008, 12:13 PM
Hello MattWorrall,

What is the sam:FormLabel control and which control do you use to invoke ajax request? Can you try replacing the RadAjaxPanel with asp:UpdatePanel and see if the same behaviour is observed?

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
John
Top achievements
Rank 1
answered on 23 Apr 2008, 12:37 PM
Hi,

<sam:FormLabel> is one of our own server controls - it just basically renders an HTML label for the control specified in the ControlToLabel property.

The events that should trigger a AJAX callback are the SelectedIndexChanged event of ddlSection and the TextChanged event of txtPageName. Both these events call a method that changes the text of the txtPageURL control.

I'll try an asp:UpdatePanel now...

Thanks,

Matt
0
John
Top achievements
Rank 1
answered on 23 Apr 2008, 01:07 PM
Hi,

I can confirm that if I use an asp:UpdatePanel rather than a RadAjaxPanel, the page works correctly and as intended.

Hope this helps,

Matt
0
Maria Ilieva
Telerik team
answered on 24 Apr 2008, 12:02 PM
Hello MattWorrall,

Will it be convenient for you to open a regular support ticket and send us sample runnable project, which replicates the problem. We will test it locally and further research on the possible causes for this issue.

Greetings,
Maria Ilieva
the Telerik team

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