"Hello World" example using ReactJS in asp.net mvc

This is our first post about ReactJS. Here I have explained a little about ReactJS and What we will learn in this series "ReactJS in ASP.NET MVC application" part by part.

This is the first part of this series. In this post, I will show you very simple "Hello World" example  using ReactJS in asp.net mvc application, where we will create a ReactJS components for show some static message  fetching from server side in our web page.
"Hello World" example using ReactJS in asp.net mvc
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ReactWithMVCPart1.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public JsonResult getmessage()
        {
            return new JsonResult { Data = "Hello World. I am from server-side", JsonRequestBehavior = JsonRequestBehavior.AllowGet};
        }
	}
}
Posted By :