Any ideas?
Thanks,
Adam
29 Answers, 1 is accepted
The problem happens because of the Ajax call not finished. If the long operation changes the RadToolBar structure (or RadToolBar has been dynamically populated), the server-side part of the control receives wrong content. It then tries raising the event from the context of a RadToolBarDropDown, or a RadToolBarItem, or a separator button, hence the error.
What you can do is disable the buttons during the ajax call and enable them after it. This can be achieved by using the client-side events of RadAjaxManager.
Best,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Could it be that you have a mix of visible and invisible items? RadToolBar for ASP.NET Ajax had a problem in this case, which could cause that problem. Could you update to the latest version?
Regards,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I'm going to try setting a javascript variable if certain toolbar buttons are clicked. If they are then I will set_cancel(true) in the clicking event. This should keep it from being allowed to attempt the postback twice.
It occurred that the problem core lies deeper than seemed first. Can you open a formal support ticket and send us a simplified version of the project, demonstrating the problem? We will do our best to find what's wrong and help immediately.
Kind regards,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I'm willing to send whatever I can, but it won't be a "working" app due to the objects and database not being in place. I can also send stack traces if they are of any assistance and I would be more than willing to do an Adobe Connect session to demonstrate the error in our environment.
Is it possible for you to scale down the application you have? Here is a possible approach:
- Copy the page (having the problem) to a blank website;
- Add the required user controls/master pages;
- Add a local copy of the database the page might use and remove the sensitive information/reduce the information as much as possible;
- If there are some controls/classes that need classes from another assembly either remove them or create some stub classes so that they let the page work;
- Start removing controls from the page one by one until the problem is gone. This would mean that the problem lies in the last removed component;
Best regards,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I'll try to get something working next week, or pinpoint it in our application and send you the exact line that seems to be the culprit.
I'm looking forward to your findings then.
Best regards,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
RadToolBarButton EditButton = new RadToolBarButton("Edit", false, "TextStyleBold");
EditButton.CssClass =
"ASP_EditBtn";
RadToolBar1.Items.Add(EditButton);
protected void RadToolBar1_ButtonClick(object sender, RadToolBarEventArgs e)
{
TestLabel.Text =
"You Clicked the " + e.Item.Text + " Button";
}
}
}
Server Error in '/' Application.
Only items of type Telerik.Web.UI.IRadToolBarButton can initiate postbacks
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Only items of type Telerik.Web.UI.IRadToolBarButton can initiate postbacks
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
Remove the dynamic code to add the buttons and add this on the page it works
<Items>
<telerik:RadToolBarButton runat="server" CssClass="ASP_AddBtn" Text="Add">
</telerik:RadToolBarButton>
<telerik:RadToolBarButton runat="server" CssClass="ASP_EditBtn" Text="Edit">
</telerik:RadToolBarButton>
</Items>
Please, find attached the page I used. Can you please, modify it to demonstrate the error? Please, open a formal support ticket to send us the modified file.
Thanks,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Terry
Thanks for the clarifications. I just modified the example to use a master page, but still no results.
Anyways, we will check this issue again once we have other clues of why it can happen.
If you guys find a repro-scenario, please, send it to us too. We will check the problem immediately.
Best regards,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I am using Telerik 2009.3 version. My specific scenario is following:
I have a grid which shows all records in large form when specific row is selected.
The form itself is in panel which is visible="false" by default and is visible when some row is selected. at first page load the form asp:panel is not visible.
When I am putting the toolbar in the form panel I am getting the error - Error: Sys.WebForms.PageRequestManagerServerErrorException: Only items of type Telerik.Web.UI.IRadToolBarButton can initiate postbacks
while when I taking RadToolBar out from this asp:panel it works just fine.
Thanks in advance,
Armen
To reproduce the problem you may check this simple code. The problem is because the container of toolbar has property of enableviewstate set the to false, I just turned it on and it works. Hope this will help to some folks that may have this issue.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestToolbar._Default" %> |
<!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></title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<telerik:radscriptmanager id="RadScriptManager1" runat="server"> |
<Scripts> |
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> |
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> |
</Scripts> |
</telerik:radscriptmanager> |
<telerik:radformdecorator runat="server" id="defaultFormDecorator" |
Skin="Forest" /> |
<telerik:radajaxloadingpanel id="defaultLoadingPanel" runat="server" |
IsSticky="True" MinDisplayTime="200" Skin="Forest" /> |
<telerik:radajaxmanager id="defaultAjaxManager" runat="server"></telerik:radajaxmanager> |
<telerik:radajaxpanel runat="server" id="supplierAjaxPanel" loadingpanelid="defaultLoadingPanel" EnableViewState="false"> |
<asp:Label ID="lblTest" runat="server"></asp:Label> |
<asp:Button id="btnShow" runat="server" onclick="btnShow_Click" Text="Show" /> |
<asp:Panel ID="pnlToolbar" runat="server" Visible="false"> |
<telerik:RadToolBar runat="server" ID="rtbManage" CssClass="Toolbar" Width="100%" |
OnButtonClick="rtbManage_ButtonClick" Skin="Forest"> |
<Items> |
<telerik:RadToolBarButton ImageUrl="~/Resources/Toolbar/Save.gif" ImagePosition="Left" |
Text="SaveText" CommandName="SaveButton" runat="server"> |
</telerik:RadToolBarButton> |
<telerik:RadToolBarButton ImageUrl="~/Resources/Toolbar/cancel.png" ImagePosition="Left" |
Text="Cancel" CommandName="Cancel" runat="server"> |
</telerik:RadToolBarButton> |
<telerik:RadToolBarButton ImageUrl="~/Resources/Toolbar/delete.png" ImagePosition="Left" |
Text="Delete" CommandName="Delete" runat="server"> |
</telerik:RadToolBarButton> |
</Items> |
</telerik:RadToolBar> |
</asp:Panel> |
</telerik:radajaxpanel> |
</form> |
</body> |
</html> |
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Web; |
using System.Web.UI; |
using System.Web.UI.WebControls; |
using Telerik.Web.UI; |
namespace TestToolbar |
{ |
public partial class _Default : System.Web.UI.Page |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
protected void rtbManage_ButtonClick(object sender, RadToolBarEventArgs e) |
{ |
RadToolBarButton btn = e.Item as RadToolBarButton; |
lblTest.Text = "Command: " + btn.CommandName; |
} |
protected void btnShow_Click(object sender, EventArgs e) |
{ |
pnlToolbar.Visible = !pnlToolbar.Visible; |
} |
} |
} |
Regards,
Armen
Please paste here sample code which we can use to replicate the issue. Thanks
Regards,
Yana
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.
Which version of the controls you are using? Please send us simple code which demonstrates the problem as I am not able to understand it. Thanks
All the best,
Yana
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.
Using Telerik Q3 SP1.
I have both telerik treeview and telerik toolbar on my usercontrol.
According to the selected node in the treeview, i am changing the RadToolBarButtons of telerik toolbar. (I mean i am clearing toolbar in the server side, and creating new buttons. -in the OnNodeClick event of treeview.-)
I am getting this exception when i click some of the buttons on telerik toolbar. (I am not getting this exception always.)
What should i do?
Can you please open a separate forum post or a support ticket and explain the issue since the one that is described in this forum post is quite old one and we have been making changes in our controls(implying that the issue may no longer appear or is already fixed).
Kind regards,
Kate
the Telerik team
Hi there,
Has this issue been solved?
I got the same problem since I upgraded telerik dlls from 2010.1.519.40 to 2016.3.914.40. It's never been caught until I applied new dlls. Is there anything changed to cause the problem?
Thanks,
Please post your ToolBar's markup declaration, which will give us an idea of how it is configured and what items it contains. In addition specify the steps needed to be followed, in order for the exception to be reproduced.
Regards,
Ivan Danchev
Telerik by Progress