May 16, 2011, 9:03 AM
[CLOSED] TargetException: Object does not match target type - error with store
On loading my view, which contains the following Store, I get an error:
"TargetException: Object does not match target type"
thanks
"TargetException: Object does not match target type"
<ext:Store ID="AddressesStore" runat="server" AutoLoad="true" AutoDataBind="true" Json="true">
<BaseParams>
<ext:Parameter Name="Id" Value="IdHidden.getValue()" Mode="Raw"/>
</BaseParams>
<UpdateProxy>
<ext:HttpWriteProxy Url="/Client/SaveAddresses/" Timeout="10000"/>
</UpdateProxy>
<Proxy>
<ext:HttpProxy Method="GET" Url="/Client/GetAddresses/" Json="true"/>
</Proxy>
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Id" Type="Int" />
<ext:RecordField Name="AccountId" Type="Int" />
<ext:RecordField Name="Address1" AllowBlank="false"/>
<ext:RecordField Name="Address2" />
<ext:RecordField Name="Address3" />
<ext:RecordField Name="Address4" />
<ext:RecordField Name="Address5" />
<ext:RecordField Name="Postcode" />
<ext:RecordField Name="Active" Type="Boolean" DefaultValue="true" />
</Fields>
</ext:JsonReader>
</Reader>
<Listeners>
<Load Handler="addDefaultFieldToAddressStore();" />
</Listeners>
</ext:Store>
My Controller action is returning an appropriate AjaxStoreResult:public AjaxStoreResult GetClientAddresses(string Id) {
AccountRepository accRepo = new AccountRepository();
IEnumerable<ClientAddress> masterAccountAddresses = accRepo.GetClientAddresses(Int64.Parse(Id));
AjaxStoreResult addresses = new AjaxStoreResult(masterAccountAddresses.ToList());
return addresses;
}
Is there a erroneous or missing setting in my View/Store causing the error?thanks
Last edited by Daniil; May 17, 2011 at 11:05 AM.
Reason: [CLOSED]