Skip to content

I am not able to get response as json. pls help me out

Christ X

Asked Sep 13, 2013, 1:10 AM EDT2 answers
Share
LinkedInX

Christxavier

Member

14 Points

84 Posts

I am not able to get response as json. pls help me out.

18 minutes ago|LINK

hi, i created one wep api crud operation using MVC.  i followed this following link to create that web api. kindly go through this link for clear.

http://www.dotnetchunks.com/Article/MVC%204%20WEB%20API%20_NET%204_5/13#.UjKapManqul


I got the GET response also. but i am getting xml response. instead  i needed json response. so in that article they told to put following javascript to get JSON response but they did not mention where to put the following javascript. so blindly i put the javascript in index.cshtml<--views<---HOME(which is in solution explorer in project). because this folder only has design form. so still i am getting xml response. if i remove the javascript also, it response xml format. so, i think the javascript is not invoked or i do not know where to put the javascript correctly. so, please help from this problem. thanks a lot.

javascript file:

output file.


output file:
1
20
rajesh
/CustomerModel>
2
 
50
magesh

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Suthish Nair
    0
    Copied from asp.net forums. Please explain the problem with more details.. What issue here you facing.
    0
  • 0
    hi Bro!,  i did not copy. i only posted in asp.net forum also. i solved with help of your previous suggession in our forum only. thanks a lot.
    0