Click here to Skip to main content
15,887,361 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: textbox wrap to several lines Pin
R. Giskard Reventlov9-Aug-12 10:02
R. Giskard Reventlov9-Aug-12 10:02 
GeneralRe: textbox wrap to several lines Pin
classy_dog9-Aug-12 12:07
classy_dog9-Aug-12 12:07 
AnswerRe: textbox wrap to several lines Pin
R. Giskard Reventlov9-Aug-12 12:40
R. Giskard Reventlov9-Aug-12 12:40 
QuestionA liitle help on submitting a json array, no-primitive to a web service Pin
jkirkerx9-Aug-12 8:49
professionaljkirkerx9-Aug-12 8:49 
AnswerI think I did it, got my json reponse back with no error during testing. Pin
jkirkerx9-Aug-12 17:03
professionaljkirkerx9-Aug-12 17:03 
QuestionRe: A liitle help on submitting a json array, no-primitive to a web service Pin
CodeHawkz9-Aug-12 20:54
CodeHawkz9-Aug-12 20:54 
AnswerRe: A liitle help on submitting a json array, no-primitive to a web service Pin
jkirkerx10-Aug-12 6:26
professionaljkirkerx10-Aug-12 6:26 
AnswerRe: A liitle help on submitting a json array, no-primitive to a web service Pin
CodeHawkz12-Aug-12 8:48
CodeHawkz12-Aug-12 8:48 
Hey there,

Glad it worked out. Post your method here as well, so I can see whether I can improve my solution Smile | :)

ExpandoObject Documentation[^]

JSON Library[^] that I used

C#
// This only works in .NET 4.0
dynamic result = new ExpandoObject();
IDictionary<string, object> resultData = (IDictionary<string, object>)result;

resultData.add("templateName", "tshirts");
var templateArray = new [] {
 new { Name = "Red", Code = "RED" },
 new { Name = "Green", Code = "GRN" },
 new { Name = "Blue", Code = "BLU" }
};

resultData.add("templateArray", templateArray);

string jsonString = JsonConvert.SerializeObject(result);


This will output a JSON string like the one you initially mentioned. I think the code is self explanatory. Feel free to reach out for further clarifications.

Hope this helps, cheers
GeneralRe: A liitle help on submitting a json array, no-primitive to a web service Pin
jkirkerx12-Aug-12 10:25
professionaljkirkerx12-Aug-12 10:25 
GeneralRe: A liitle help on submitting a json array, no-primitive to a web service Pin
CodeHawkz12-Aug-12 17:23
CodeHawkz12-Aug-12 17:23 
GeneralRe: A liitle help on submitting a json array, no-primitive to a web service Pin
jkirkerx13-Aug-12 7:17
professionaljkirkerx13-Aug-12 7:17 
GeneralRe: A liitle help on submitting a json array, no-primitive to a web service Pin
CodeHawkz29-Aug-12 19:17
CodeHawkz29-Aug-12 19:17 
GeneralRe: A liitle help on submitting a json array, no-primitive to a web service Pin
jkirkerx30-Aug-12 6:04
professionaljkirkerx30-Aug-12 6:04 
GeneralRe: A liitle help on submitting a json array, no-primitive to a web service Pin
CodeHawkz30-Aug-12 20:34
CodeHawkz30-Aug-12 20:34 
GeneralRe: A liitle help on submitting a json array, no-primitive to a web service Pin
jkirkerx31-Aug-12 6:25
professionaljkirkerx31-Aug-12 6:25 
QuestionPage.Response.Redirect not working Pin
dcof9-Aug-12 5:21
dcof9-Aug-12 5:21 
AnswerRe: Page.Response.Redirect not working Pin
jkirkerx9-Aug-12 6:50
professionaljkirkerx9-Aug-12 6:50 
AnswerRe: Page.Response.Redirect not working Pin
AspDotNetDev9-Aug-12 6:51
protectorAspDotNetDev9-Aug-12 6:51 
AnswerMessage Closed Pin
9-Aug-12 8:14
professionaljkirkerx9-Aug-12 8:14 
GeneralRe: Page.Response.Redirect not working Pin
dcof9-Aug-12 12:11
dcof9-Aug-12 12:11 
GeneralRe: Page.Response.Redirect not working Pin
jkirkerx9-Aug-12 17:09
professionaljkirkerx9-Aug-12 17:09 
GeneralRe: Page.Response.Redirect not working Pin
dcof9-Aug-12 18:40
dcof9-Aug-12 18:40 
AnswerRe: Page.Response.Redirect not working Pin
dipurajp10-Aug-12 2:42
dipurajp10-Aug-12 2:42 
GeneralRecursion from asp classic to asp net Pin
EnricoRS19-Aug-12 4:45
EnricoRS19-Aug-12 4:45 
AnswerRe: Recursion from asp classic to asp net Pin
Wes Aday9-Aug-12 5:54
professionalWes Aday9-Aug-12 5:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.