Posts Tagged Ajax

MVC2 LoadingElementID not displaying in Safari

I have a MVC2 project that I am using Ajax form, ajax indicator div (LoadingElementId=”indicator”) displays perfectly in IE, Firefox and Chrome, but it doesn’t display in Safari.

Solution:  change “display:none;” to “visibility:hidden;” in ajax indicator’s css class. Now it works for all browsers above.

, , , , , ,

Leave a comment

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.

 

 

, , , , , ,

Leave a comment

use Colobox with ASP.NET Ajax

 Colorbox is built on Jquery library,  by default, the colorbox link only works when the first time it loads or postback etc.  However ASP.NET Ajax is partial postback,  so after ajax update you may find colobox are not working any more.

Below post describes the problem on Jquery with Ajax update panel and provide a good solution

http://www.dotnetfunda.com/articles/article471-jquery-and-aspnet-ajax-updatepanel-.aspx

It can be used on colorbox as well, open jquery.colorbox.js  and add a function “pageLoad” ,and copy the content from “$(document).ready(function(){” to “pageLoad”

$(document).ready(function(){
     $(“.example7″).colorbox({width:”80%”, height:”80%”, iframe:true});
});
 
function pageLoad(sender,args){

if (args.get_isPartialLoad())

   {
       $(“.example7″).colorbox({width:”80%”, height:”80%”, iframe:true});

   }

}

   



 

,

Leave a comment