-
Notifications
You must be signed in to change notification settings - Fork 0
/
HomeController.cs
40 lines (34 loc) · 1.11 KB
/
HomeController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Collections;
using System.IO;
using DevExpress.Web.Internal;
using DevExpress.Razor.Models;
using System.Web.Script.Serialization;
namespace DevExpress.Razor.Controllers {
public class HomeController : Controller {
public ActionResult Index() {
ViewBag.Message = "Welcome to DevExpress Extensions for ASP.NET MVC!";
return View();
}
public ActionResult CallbackPanelPartial() {
ViewData["Data"] = GetSerializationObject();
return PartialView("CallbackPanelPartial");
}
MyData GetSerializationObject() {
string jsonText = Request.Params["SerializationData"];
if (string.IsNullOrEmpty(jsonText))
return null;
MyData data = null;
try {
data = new JavaScriptSerializer().Deserialize<MyData>(jsonText);
} catch {
ViewData["ErrorMessage"] = "Incorrect data";
}
return data;
}
}
}