Mahbub
Mahbub

Reputation: 339

Load and Read XML file in asp.net MVC

I am facing a problem while working with xml file in asp.net mvc 5. I need to load a xml file. and read the xml data in different views. which have individual controller too. I have loaded the xml file successfully. But I can not catch the idea how can I pass the xml file data to other controller. Like I have a Controller for loading the xml file. And I have another controller to read the xml data. Can you guys give me the idea how to do the rest work?

Upvotes: 0

Views: 3227

Answers (1)

Mahbub
Mahbub

Reputation: 339

Sorry for my late answer. The problem was that I did not get full directory path to read the file. Then I created a cache memory to save the file and read it. And to read data in several controller I used like, Session["abc"] = "asas"; And to get this information in other controller, Viewbag.abc = Session["abc"];

Upvotes: 1

Related Questions