Henrry Ramirez@henryraygan
Hola, me encuentro trabajando en un proyecto legacy, siendo muy sincero es la primera ocasión que trabajo con ASP.NET y C#.
Por configuraciones anteriores no puedo usar el MVC al 100% por ciento, realmente sólo son sitios estáticos, por ende solo usamos la vistas, así que he decidido controlar la información en Diccionarios, haciendo algo similar al uso de JSON como se usan en otros motor de templates como handlebars.
Mi duda es, como puedo hacer los equivalentes de JSON en Diccionarios de C#, por ejemplo, hice lo siguiente:
JSON:
"about": {
"title": "Texto",
"description": [ "texto", "texto.", "texto" ]
}
ascx (c#):
<%@ Control Language="C#" %>
<%
var About = new Dictionary<string, string[]>() {
{ "title", new string[] {"texto" } },
{ "description", new string[] {
"texto",
"texto.",
"texto."
}
}
};
ViewData["dicAbout"] = About;
%>
Quiero saber como replicar este formato json en ascx (c#)
"our_oferts": {
"title": "Title",
"items": [
{
"cover": "path/foto.png",
"title": "Title Text",
"redirect": "..."
},
{
"cover": "path/foto.png",
"title": "Title Text",
"redirect": "..."
},
{
"cover": "path/foto.png",
"title": "Title Text",
"redirect": "..."
}
]
}