ASP.NET MVC测试版的Ajax升级问题 [英] ASP.NET MVC Beta Ajax upgrade problem

查看:143
本文介绍了ASP.NET MVC测试版的Ajax升级问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在等待了一段时间,现在把我的Asp.net preVIEW 4项目达到标准,完全跳过preVIEW 5只因为我知道我有一些问题。

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.

我在网站上,我有一个Ajax更新类型面板,使得使用这种技术在这里发现了一个视图内容的几个领域。 AJAX面板的ASP.NET MVC

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

这工作得很好在preVIEW 4,但现在在公测我不断收到这个..

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...

我的code看起来像这样

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>

所以基本上什么它做的是强制提交表单,这将更新与PANEL1从视图ReportOne上的内容。

so basically what its doing is forcing the submit on the form, which updates panel1 with the contents from the view ReportOne.

我在想什么?为什么会出现这个错误?他们为什么去改变的事情呢?我爱MVC但这让我疯了。

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.


var event = new Object();
function refreshInformation(){
document.forms['MyForm'].onsubmit({preventDefault: function(){} });
}

这是我目前的code,它工作正常的更新的形式。问题是无功事件破坏了所有其他JavaScript事件,如果我有,例如这样的:

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:


<img src="myimg.gif" onmouseover="showmousepos(event)" />

它不是的已发送到该函数的鼠标事件,相反,它是我的无功事件,我必须声明,以获得的onsubmit正常工作。

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.

当仅使用

onsubmit({preventDefault: function(){} }

无VAR事件:我得到了

without the "var event" I get the

Sys.ArgumentNullException: Value cannot be null Parameter name eventObject

我也试着使用

submit()

这不完全回发,完全忽略当作ajaxForm东西。 ..at至少在我的解决方案。

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.

这篇关于ASP.NET MVC测试版的Ajax升级问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆