0

As I am working on Asp.Net MVC 3, I want to create an UI based on JSON object.

E.g. Consider that I have a complex JSON object which contains string, array, boolean properties with data.

Now, I want to create an UI which should render dynamic textbox based on JSON object.

For example, if my JSON object have array inside it, then it should generate dynamic gridview kind of UI which should contains textbox inside it.

In short, I want to create a dynamic view based on JSON object.

Could anybody please suggest me how could I achieve this?

Thanks in advance.

(Could anybody suggest on this?)

nunu
  • 3,184
  • 10
  • 43
  • 58
  • 1
    Have you tried something? There is some moments, which you are not described. From where you get JSON? AJAX? – Sergey Metlov Nov 03 '11 at 05:49
  • See what I will do it.. I will have a JSON string response by calling web service and then I will deserialize in my C# poco class, and I want to create dynamic UI from this my C# poco class object... – nunu Nov 03 '11 at 05:57
  • 1
    I would go for some EditorTemplates for a fully fledged C# Model. Once you go with Js/JSON you're doomed to client side programming, and actually loose the powe of Razor views. – BigMike Nov 03 '11 at 08:42

1 Answers1

0

This is more of a question about javascript UI than c#. It sounds like your controller methods are all set in terms of returning the appropriate JSON result.

There are a number of javascript mvc frameworks that are meant to be used for complex client applications. javascript MVC and sproutcore are the 2 i'm most familiar with but there are others

Bootstrap from twitter is a rich stylesheet and javascript solution that makes it easy to build relatively nice UIs.

YUI from yahoo is the grandfather of javascript frameworks, but it has a lot of widgets as does jquery UI

Community
  • 1
  • 1
Jason
  • 15,915
  • 3
  • 48
  • 72
  • sure, but these do all just care about structuring your client-side JavaScript web application but do not provide facilities for dynamically creating views out of JSON objects. – Juri Nov 03 '11 at 07:12