|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Net;
namespace ApiBrowser1.Controllers
{
public class JsonController : Controller
{
//
// GET: /Json2/
public ActionResult Index()
{
return View();
}
public JsonResult JsonData1(string searchengine, string url1, string parameter)
{
string appid = "";
switch (searchengine)
{
case "Google":
appid = "";
break;
case "Yahoo":
appid = "Use your appid here";
break;
case "Bing":
appid = "Use your appid here";
break;
default:
break;
}
string urselected = url1 + parameter + appid;
WebClient serviceRequest = new WebClient();
var JsonResponse = serviceRequest.DownloadString(new Uri(urselected));
return Json(JsonResponse, JsonRequestBehavior.AllowGet);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Vijay Kumar: Architect, Programmer with expertise and interest in Azure, .net, Silverlight, C#, WCF, MVC, databases and mobile development. Concentrating on Windows Phone 7 and Windows Azure development. Lived in California for many years and done many exciting projects in dotnet and Windows platforms. Moved to Raleigh (RTP), North Carolina recently and available for consulting. Blog http://Silverazure.blogspot.com.