JSon

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    #1

    JSon

    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":"017b2 53e-596b-4328-85f5-
    fd97a783759c"," Name":"Física", "FileTags":[],"ProfessorTags ":[]},
    {"TagID":"3fae2 160-55f6-4dd0-b856-
    fd27f5d307e2"," Name":"Matemáti ca","FileTags ":[],"ProfessorTags ":[]},
    {"TagID":"883b1 97e-0cb3-4528-8403-0877d742bf47"," Name":"Matemáti ca
    B","FileTags ":[],"ProfessorTags ":[]},{"TagID":"f18 3cb9d-9d92-4c61-b03a-
    e51cc1205b2b"," Name":"Portuguê s","FileTags ":[],"ProfessorTags ":[]}]

    Could someone tell me how to do this?

    Thanks,

    Miguel
  • Munna

    #2
    Re: JSon

    Hi

    This is what you need i think...
    check it out..
    ASPCode Dev Cloud gives developers secure tunnels, webhook debugging, instant JSON APIs, and browser-based SQL practice in one platform.


    Best of luck

    -----------
    Munna




    Comment

    • shapper

      #3
      Re: JSon

      On Jul 13, 4:59 pm, Munna <munna...@gmail .comwrote:
      Hi
      >
      This is what you need i think...
      check it out..http://www.aspcode.net/JQuery-and-AS...sses-with-JSON....
      >
      Best of luck
      >
      -----------
      Munna
      >
      https://www.munna.shatkotha.com/blog....shatkotha.com
      Hi,

      I created the following for testing purposes:

      /// <summary>
      /// Summary description for $codebehindclas sname$
      /// </summary>
      [WebService(Name space = "http://tempuri.org/")]
      [WebServiceBindi ng(ConformsTo = WsiProfiles.Bas icProfile1_1)]
      public class MyData : IHttpHandler {

      public void ProcessRequest( HttpContext context) {
      context.Respons e.ContentType = "text/plain";
      context.Respons e.Write("[{'TagID':'3fae2 160-55f6-4dd0-b856-
      fd27f5d307e2',' Name':'Matemáti ca','FileTags':[],'ProfessorTags ':[]},
      {'TagID':'883b1 97e-0cb3-4528-8403-0877d742bf47',' Name':'Matemáti ca
      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

      Comment

      Working...