Archive for category Ajax
so place following code in our View (be aware that I am using Razor as my view engine)
Nice and clean… upon click the above link will do a call back to Read method of our Home controller and will replace the result from that method in Div5.
Hit F5 and this will be rendered into your browser let’s inspect the resulting HTML
<a data-ajax=”true” data-ajax-method=”Get” data-ajax-mode=”replace” data-ajax-update=”#div34″ href=”/Home/Home/Read”>
notice that behind the scene it’s using HTML5 style annotations… now click on the link and you will find that instead of doing Callback the link is simply doing a post back…. wow… what has gone wrong…. doing a little google on this suggest that we should include MicrosoftAjax.js and MicrosoftMvcAjax.js in our view but this doesn’t solves the problem… after some research I had figured that out you need to include mainly “jquery.unobtrusive-ajax.js” and it will work like a charm
i have planned to maintain a list of tools from different sources in order to create a Must Have tools list for me.
this list will have java script related tools, if you guys have any other particular tool in mind do let me know.
Java script Tools
Java Script Frameworks
I came across an effort from Microsoft Live labs named “Seadragon Ajax” :), its same as Silverlight deep zoom just fact is that Seadragon is an Ajax based zooming and is available for installation for free or even you can use Microsoft Provide hosted application and can provide the embed code in your site or blog
following is an example
following are popular Ajax frameworks.
i have tried many of them but i would prefer Microsoft Asp.net Ajax, Dojo and Anthem.Net
yesterday I came across a very nasty problem…. i was working on a Survey application which at end has to display a Ajax based chart… every thing was completed but during testing if you are clicking on same option again and again nothing is happening it was showing the same old records… but changing the option was fixing the problem….after doing some Google i found that IE caches every Get call…..
i tried to replace the Get call with Post but woo! it was working fine locally but on webserver it was giving error…..
during all this research i came across a very nice BLOG
with some fine working solutions posted on Davis’ Blog…
using proxy settings in Ajax
but this only works for me when object is of type winhttp
Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5")
objWinHttp.Open "POST", strURL
objWinHttp.SetProxy 2, "proxy1:8080"
objWinHttp.SetCredentials "gooddomain\userid", "goodpassword", 1
objWinHttp.SetRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded"
objWinHttp.SetTimeouts 30000, 30000, 30000, 30000
if Err.number <> 0 then strHTML = "There is a problem in reaching the Remote host. Please try again later, or contact the Content Manager if the problem persists. Error: " & Err.number & " " & Err.description & strURL & " " strHTML = strHTML & "Status: " & objWinHttp.Status & " " & objWinHttp.StatusText ‘ Get the text of the response. else strHTML = objWinHttp.ResponseText end if Set objWinHttp = Nothing ‘return the html to the calling program GlobalScreenScrapex = strHtml end Function