0
votes

I have created a page Main.html in witch there is a ViewModel. In this page there is a button that open a Window Modal and load in it a html page in ajax.

I want to use the viewmodel of the main.html in my window modal, but if I call the viewmodel it do error..

Does someone know how can I resolve?

1
Could you put some code? What error do you receive? - Pablo Claus
AFAIK if you load a page via ajax it uses an iframe for containing it. For accessing container page data from an iframe take a look into stackoverflow.com/a/1301645/1802671 - OnaBai

1 Answers

0
votes

Load a partial view in to your modal and make sure it has the proper using statement to allow it to use your model:

@using YourApp.YourModels.TheModel