JSon

Discussion in 'ASP .Net' started by shapper, Jul 13, 2008.

  1. shapper

    shapper Guest

    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
     
    shapper, Jul 13, 2008
    #1
    1. Advertising

  2. shapper

    Munna Guest

    Munna, Jul 13, 2008
    #2
    1. Advertising

  3. shapper

    shapper Guest

    On Jul 13, 4:59 pm, Munna <> wrote:
    > 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
    >
    > -----------
    > Munna
    >
    > www.munna.shatkotha.com/blogwww.munna.shatkotha.comwww.shatkotha.com


    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
     
    shapper, Jul 13, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Florian Frank
    Replies:
    0
    Views:
    267
    Florian Frank
    Jun 30, 2009
  2. sajuptpm
    Replies:
    2
    Views:
    410
    sajuptpm
    Dec 28, 2012
  3. Acácio Centeno
    Replies:
    1
    Views:
    313
    dieter
    Feb 15, 2013
  4. Bryan Britten
    Replies:
    9
    Views:
    301
    Bryan Britten
    May 28, 2013
  5. David Karr
    Replies:
    1
    Views:
    197
    David Karr
    Jun 17, 2013
Loading...

Share This Page