Explain how to emit JSON from an ASP.NET Web Forms application?
In Web forms this can be achieved with the help of Http Handlers.
- In your web form project create a new Generic Http Handler. Right click the project, Add new Item >> Generic handler (file with ashx extension)
- In the ProcessRequest function create and return JSON string as follows
a. Create object of your .net class and initialize properties with values.
c. Set your return type as JSON and return the above created string.
How to consume that emitted JSON later?
Looking for training?
(MVC, WCF, Design Patterns, MSBI, JSON, WPF, ALM using VSTS, jQuery, HTML 5)We provide all kinds of trainings on various technologies. Visit www.JustCompile.com for detail.