JSon

S

shapper

Hello,

I need to create an aspx file which returns a JSON string.

In fact I want to return a specific string for testing a JQuery code I
am working in:

[{"TagID":"017b253e-596b-4328-85f5-
fd97a783759c","Name":"Física","FileTags":[],"ProfessorTags":[]},
{"TagID":"3fae2160-55f6-4dd0-b856-
fd27f5d307e2","Name":"Matemática","FileTags":[],"ProfessorTags":[]},
{"TagID":"883b197e-0cb3-4528-8403-0877d742bf47","Name":"Matemática
B","FileTags":[],"ProfessorTags":[]},{"TagID":"f183cb9d-9d92-4c61-b03a-
e51cc1205b2b","Name":"Português","FileTags":[],"ProfessorTags":[]}]

Could someone tell me how to do this?

Thanks,

Miguel
 
S

shapper

Hi

This is what you need i think...
check it out..http://www.aspcode.net/JQuery-and-ASPNET-returning-classes-with-JSON....

Best of luck

Hi,

I created the following for testing purposes:

/// <summary>
/// Summary description for $codebehindclassname$
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class MyData : IHttpHandler {

public void ProcessRequest(HttpContext context) {
context.Response.ContentType = "text/plain";
context.Response.Write("[{'TagID':'3fae2160-55f6-4dd0-b856-
fd27f5d307e2','Name':'Matemática','FileTags':[],'ProfessorTags':[]},
{'TagID':'883b197e-0cb3-4528-8403-0877d742bf47','Name':'Matemática
B','FileTags':[],'ProfessorTags':[]}]");
}

public bool IsReusable {
get {
return false;
}
}
}

However, I don't want to create and compile a project. I want only to
upload this to my server ... how can I call this from a simple aspx
page?

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top