I been waiting for sometime now to bring my Asp.net Preview 4 project up to snuff, totally skipping Preview 5 just because I knew I would have some issues.
Anyhow, here is the question and dilemma.
I have a few areas on the site which I have an ajax update type panel that renders content from a view using this technique found here. AJAX Panels with ASP.NET MVC
This worked fine in preview 4 but now in the beta I keep getting this ..
Sys.ArgumentNullException: Value cannot be null Parameter name eventObject
It has been driving me nuts…
My code looks like this
<% using (this.Ajax.BeginForm('ReportOne', 'Reports', null, new AjaxOptions { UpdateTargetId = 'panel1' }, new { id = 'panelOneForm' })) { } %> <div class='panel' id='panel1'><img src='/Content/ajax-loader.gif' /></div> <script type='text/javascript'> $get('panelOneForm').onsubmit(); </script>
so basically what its doing is forcing the submit on the form, which updates panel1 with the contents from the view ReportOne.
What am I missing? Why am I getting this error? Why did they go and change things? I love MVC but this is making me crazy.
Having some irritating problems relating to this issue. Hope someone here can help me out.
This is my current code, it works fine for updating the the form. Problem is the ‘var event’ disrupts all other javascript events, if I have for example this:
its not the mouse event that’s sent to the function, instead it’s my ‘var event’ that I must declare to get the onsubmit to function properly.
When using only
without the ‘var event’ I get the
I’ve also tried using
this does a full postback and totally ignores the ajaxform stuff…at least in my solution.
Hmm…I realize this might be a little confusing, but if someone understands the problem, it would be great if you had a solution as well. =) If you need more info regarding the problem please just ask and I’ll try to elaborate som more.