Introduction

This article describes how to use AJAX functionality using the popular JavaScript library (jQuery) with a minimal amount of code without using ASP.NET 2.0 AJAX tool kit. ASP.NET 2.0 does not support JSON so this will help if you want to use ASP.NET 2.0.

This example has two drop down controls for customer and customer description. Customer description will be loaded when customer drop down changes without reloading the entire page.

Using the Code

JQuery library files need to be included to the project as shown above.

Share

About the Author

Pubudu Kasakara is working as Solution Architect in Singapore. He has more than 11 years of professional involvement in the IT industry. Worked in successful projects involving mainly the Service Oriented Application by contributing to all requirements gathering, design and implementation phases. He is having experience with SOA applications development, Microsoft .NET, BizTalk, He is member of Charted It professional in UK.

All I need is to pass a JSON data as a parameter to a javascript function. This JSON object may be one or more images, which is to be fetched from the database (SQL Server 2005) before passing it as a parameter(JSON object) to a javascript function, which displays the slide show of those images.

I need to know if this is a possible task. If it is so how can i get it done. I would be very much pleased if anyone could provide me a solution.

If your framework is 3.5 then yes you dont need JSON handler as it has JSON functionality in built.This code is for 2.0. .NET 2.0 does not have in built JSON so I wrote JSON handler which you can use in 2.0.

Please let me know if I've misunderstood, but it seems like a bunch of hoops to jump through just to get JSON back, when ASP.Net will do this for you. If you have a method decorated with the attribute,

<WebMethod(enableSession:=True)> Public Function GetCacheValue(key As String) As Object
Return HttpRuntime.Cache(key)
End Function