MVC2 Ajax not working in Firefox – Error “a is undefined”

I was using MVC2 Ajax function with “this.form.onsubmit()”, it works on IE but not firefox, it causes an error “a is undefined” in /scripts/MicrosoftAjax.js    Line 6

if I use /scripts/MicrosoftAjax.debug.js , it says “Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: eventObject”

The solution is here http://forums.asp.net/t/1515105.aspx/2/10  solved by tpeczek.

1. add a hidden submit button in the form, for example:

<inputtype=submit id=”AJAXSubmitButton”name=”AJAXSubmitButton”value=”Update”style=”display:none;/>

2. change ajax call function to

document.getElementById(“AJAXSubmitButton”).click();

so you are forcing the submit button to be clicked, to submit the ajax form.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s