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

AjaxManager and user controls

1 Answer 121 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
mro
Top achievements
Rank 1
mro asked on 25 Apr 2008, 05:31 PM
Hello Telerik,
Here is the problem for today:
I have a telerik grid which is setup like this:

<telerik:RadGrid ID="RadGrid1" Width="1100px" runat="server" AllowPaging="True" AllowSorting="True"  
            AutoGenerateColumns="False" AutoGenerateEditColumn="True" DataSourceID="ODS" 
            GridLines="None" Skin="Hay" OnItemCommand="RadGrid1_ItemCommand" OnItemCreated="RadGrid1_ItemCreated"
            <MasterTableView DataSourceID="ODS" DataKeyNames="ID,CUST_ID,ACCOUNT_ID"
                <RowIndicatorColumn Visible="False"
                    <HeaderStyle Width="20px" /> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn Resizable="False" Visible="False"
                    <HeaderStyle Width="20px" /> 
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" 
                        ReadOnly="True" SortExpression="ID" UniqueName="ID"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="CUST_ID" DataType="System.Int32" HeaderText="CUST_ID" 
                        SortExpression="CUST_ID" UniqueName="CUST_ID"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="DATE" DataType="System.DateTime" HeaderText="DATE" 
                        SortExpression="DATE" UniqueName="DATE"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="AMOUNT" DataType="System.Decimal" HeaderText="AMOUNT" 
                        SortExpression="AMOUNT" UniqueName="AMOUNT"
                    </telerik:GridBoundColumn> 
                </Columns> 
                <EditFormSettings EditFormType="WebUserControl" UserControlName="~/UserControls/Controls_Container.ascx"  >              
                </EditFormSettings> 
            </MasterTableView> 
        </telerik:RadGrid> 

Data source is ObjectDataSource.
The ~/UserControls/Controls_Container.ascx contains 3 controls:
DetailsView, ASP.net gridview and Telerik grid.

Everything works ok until i add this:

<telerik:RadAjaxManager ID="MasterAjaxManager" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
</telerik:RadAjaxManager>

If you click "edit" and then sort 3 times you will get:
Validation of view state MAC failed. If this app is hosted by web farm.....

Tried to add mashine key to config, tried to add ajaxmanagerproxy to each control, then to just controls container, tried this post:
http://www.telerik.com/community/forums/thread/b311D-bbtahh.aspx,
and already spent more then 10 hours trying figure out what to do and my boss is getting nervous.
If i do this it works:
EnableViewStateMac="false"
EnableEventValidation="false"
ViewStateEncryptionMode="false"
ValidateRequest="false"

It even works if controls are ajaxified and grid is not. Does anybody have a solution for this or should I just remove ajax?
Thank you,
Mario








1 Answer, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 28 Apr 2008, 03:52 PM
Mario-

This is definitely a unique problem. I imagine that there could be some content in your Grid that is causing this built-in ASP.NET security error to be thrown. The simplest solution is obviously to disable the ASP.NET default security tool, which is not a problem if this is an intranet application. The "security" that the MAC validation provides in this case is specially trying to guard against people that manipulate your page request maliciously.

If you do need these security items turned on, please send a simple demo app to our support system that exhibits the problem you're describing. That will be the fastest way for us to debug your setup and figure out why you're experiencing this unique problem. As a general rule, there should be no problems with what you're doing, so there must be something special about the data your rendering that's causing this problem.

I apologize for the trouble and inconvenience and hope we can help you find  a solution quickly.

-Todd
Tags
Ajax
Asked by
mro
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
Share this question
or