What is actually being sent to the server when dojo.xhrPost runs? You
can use Firebug or Fiddler to check this. Look at this line from your
stack trace:

"Could not convert parameter with value 'System.String[]' to expected
type System.Int64"

This could indicate that you may be sending more than one value for ID
through to the server.

On Wed, Apr 22, 2009 at 3:49 PM, Terry Massey <[email protected]> wrote:
> OK this is the strangest Issue I have seen and I am not sure how to
> continue. I have the following Javascript Code to Post a Form.
>
> function PostAction (ContentDiv,FormToPost,UrlAction )
>
>         {
>
>               dojo.xhrPost( {
>
>                url: UrlAction,
>
>                form: FormToPost,
>
>                load: function (data) { dojo.byId(ContentDiv).innerHTML =
> data; },
>
>                error: function(error) { alert(error); }
>
>                });
>
>            }
>
>
>
> I have the following Form Tag to call the JavaScript
>
>
>
> <form  method="post" id="frmPriority" onsubmit=" javascript:
> PostAction('PriorityContent','frmPriority','/PM/SaveAddProjectPriority.EGS');"
>>
>
>
>
>
>
> And the following Controller Code which successfully saves the record but
> does not render my shared view it sends me to the rescue page and does not
> enter my Catch. So no exception occurs in my code. However if I uncomment my
> Response.Redirect and comment out my other code after the with statement it
> redirects the user to that view and it re-renders the entire page not my
> intention. I simply want to re-render my table of Priorities. Simple AJAX
> right.
>
> Public Sub SaveAddProjectPriority(ByVal id As Long, ByVal name As String,
> ByVal description As String)
>
>             Try
>
>                 Dim oProjects As Project() =
> Project.FindAllByProperty("ProjectID", id)
>
>                 Dim oProject As Project = oProjects(0)
>
>                 Dim oPriority As New ProjectPriority
>
>                 With oPriority
>
>                     .Project = oProject
>
>                     .ProjectPriorityDescription = description
>
>                     .ProjectPriorityName = name
>
>                     .Save()
>
>                 End With
>
>                 oProjects = Project.FindAllByProperty("ProjectID", id)
>
>                 oProject = oProjects(0)
>
>                 PropertyBag.Add("ProjectPrioritys",
> oProject.ProjectPriorities)
>
>                 RenderSharedView("/PM/Prioirties", True)
>
>             Catch ex As SystemException
>
>                 Response.Write(ex.ToString)
>
>             End Try
>
>             'Response.Redirect("/PM/EditProjectProperties.EGS?ID=" & id,
> True)
>
>         End Sub
>
> What is really strange is the view I am calling to RenderSharedView  I know
> renders because I have the Line in my Main view the shows it’s content.
>
>
>
> <div class="content" id="PriorityContent">
>
> #parse("/PM/Prioirties.vm")
>
> </div>
>
>
>
>
>
> I am at the end of my sanity on this one I am using Build 1080 from trunk.
> MonoRail + ActiveRecord + DOJO + Big Error on post  = Build 1080 but I was
> using RC3 and it did this moved to trunk and same thing. Error Below from my
> Rescue page.
>
>
>
> Unexpected error happenend
>
> This is the rescue page and it is supposed to show you a nice message. View
> the source for more details on the exception, though.
>
> MonoRailException Message: Error building method arguments. Last param
> analyzed was ID with value '' StackTrace: at
> Castle.MonoRail.Framework.SmartDispatcherController.BuildMethodArguments(ParameterInfo[]
> parameters, IRequest request, IDictionary`2 actionArgs) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\MonoRail\Castle.MonoRail.Framework\SmartDispatcherController.cs:line
> 331 at
> Castle.MonoRail.Framework.SmartDispatcherController.InvokeMethod(MethodInfo
> method, IRequest request, IDictionary`2 extraArgs) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\MonoRail\Castle.MonoRail.Framework\SmartDispatcherController.cs:line
> 80 at
> Castle.MonoRail.Framework.ActionMethodExecutorCompatible.Execute(IEngineContext
> engineContext, IController controller, IControllerContext context) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\MonoRail\Castle.MonoRail.Framework\ActionMethodExecutor.cs:line
> 86 at Castle.MonoRail.Framework.Controller.RunActionAndRenderView() in
> c:\ccnet\CastleWorkDir\WorkingDirectory\MonoRail\Castle.MonoRail.Framework\Controller.cs:line
> 1627
>
>
>
> Inner exception: BindingException Message: Exception converting param 'ID'
> to System.Int64. Check inner exception for details StackTrace: at
> Castle.Components.Binder.DataBinder.BindParameter(Type desiredType, String
> paramName, CompositeNode treeRoot) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\Components\Binder\Castle.Components.Binder\DataBinder.cs:line
> 136 at
> Castle.MonoRail.Framework.SmartDispatcherController.BuildMethodArguments(ParameterInfo[]
> parameters, IRequest request, IDictionary`2 actionArgs) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\MonoRail\Castle.MonoRail.Framework\SmartDispatcherController.cs:line
> 316
>
>
>
> Inner exception: BindingException Message: Conversion error: Could not
> convert parameter with value 'System.String[]' to expected type System.Int64
> StackTrace: at
> Castle.Components.Binder.DefaultConverter.ThrowInformativeException(Type
> desiredType, Object input, Exception inner) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\Components\Binder\Castle.Components.Binder\DefaultConverter.cs:line
> 128 at Castle.Components.Binder.DefaultConverter.Convert(Type desiredType,
> Type inputType, Object input, Boolean& conversionSucceeded) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\Components\Binder\Castle.Components.Binder\DefaultConverter.cs:line
> 92 at Castle.Components.Binder.DataBinder.ConvertLeafNode(Type desiredType,
> LeafNode lNode, Boolean& conversionSucceeded) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\Components\Binder\Castle.Components.Binder\DataBinder.cs:line
> 651 at Castle.Components.Binder.DataBinder.ConvertToSimpleValue(Type
> desiredType, String key, CompositeNode parent, Boolean& conversionSucceeded)
> in
> c:\ccnet\CastleWorkDir\WorkingDirectory\Components\Binder\Castle.Components.Binder\DataBinder.cs:line
> 670 at Castle.Components.Binder.DataBinder.BindParameter(Type desiredType,
> String paramName, CompositeNode treeRoot) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\Components\Binder\Castle.Components.Binder\DataBinder.cs:line
> 128
>
>
>
> Inner exception: InvalidCastException Message: Object must implement
> IConvertible. StackTrace: at System.Convert.ChangeType(Object value, Type
> conversionType, IFormatProvider provider) at
> System.Convert.ChangeType(Object value, Type conversionType) at
> Castle.Components.Binder.PrimitiveConverter.Convert(Type desiredType, Type
> inputType, Object input, Boolean& conversionSucceeded) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\Components\Binder\Castle.Components.Binder\PrimitiveConverter.cs:line
> 44 at Castle.Components.Binder.DefaultConverter.Convert(Type desiredType,
> Type inputType, Object input, Boolean& conversionSucceeded) in
> c:\ccnet\CastleWorkDir\WorkingDirectory\Components\Binder\Castle.Components.Binder\DefaultConverter.cs:line
> 82
>
>
>
>
>
>
>
> Thanks Any Advice IS apriciated I am losing my mind!!!!
>
> Terry Massey
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to