TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ravi Patel
275
6.8k
1.4m
how to iterate the object and print the property and valu
Dec 13 2016 8:08 AM
Hi All,
let suppose i have json file like this
{
"url": "http://google.com",
"Viewmodel": {
"recipientId": 0,
"firstName": null,
"lastName": null
}
}
but above json structure changing every time so i can not create class
so for i have tried bellow
//get the Json filepath
string file = Server.MapPath("~/App_Data/output.json");
//deserialize JSON from file
string stringobj = System.IO.File.ReadAllText(file);
JavaScriptSerializer ser = new JavaScriptSerializer();
Object o= ser.Deserialize<Object>(stringobj);
foreach (var item in o)
{
// print the property but how ?
// print the value but how?
}
Reply
Answers (
3
)
How to Validate Image Height and Width Using Javascript.
Installation of typescript