Archive for category Ajax

@Ajax.ActionLink doing a postback (MVC)

lately I was doing some MVC3 hands on, I have seen that Microsoft has introduced an Ajax helper “@Ajax” which allows you to utilitze Ajax based calls without writing extra JavaScript (great isn’t it?)

so place following code in our View (be aware that I am using Razor as my view engine)

@Ajax.ActionLink("Click here to make javascript call", "Home/Read", new AjaxOptions { HttpMethod="Get
   , InsertionMode=InsertionMode.Replace, UpdateTargetId=”div5”})

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”>
Click here to make javascript call</a>

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

"jquery-1.5.1.min.js"
"jquery.unobtrusive-ajax.min.js"

kick it on DotNetKicks.com

, ,

2 Comments

JavaScript/Ajax Tools List (Must have Tools)

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

Technorati Tags:

Leave a comment

Microsoft Live Labs: Seadragon Ajax

I came across an effort from Microsoft Live labs named “” :), 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

 

Technorati Tags: ,

 

kick it on DotNetKicks.com Shout it

Leave a comment

Popular Ajax Frameworks

following are popular Ajax frameworks.
i have tried many of them but i would prefer Microsoft Asp.net Ajax, Dojo and Anthem.Net

  • Microsoft Asp.net Ajax Framework (works with Dotnet 2.0 only)
  • Yahoo Developer Framework
  • Dojo
  • Anthem.Net
  • Prototype
  • Script Aculous
  • Taconite
  • Rico
  • DWR
  • Leave a comment

    IE caching problem with Ajax

    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…

    Leave a comment

    Ajax.NET Professional New Released

    Leave a comment

    Making XMLRequest Through Proxy Server

    using proxy settings  in Ajax

    but this only works for me when object is of type winhttp

    dim objWinHttp
    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
    objWinHttp.Send m_cPostBuffer
    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

    Orignal Article

    Leave a comment