Reputation: 25
I have a controller which creates a url for an iFrame by calling a webservice. I need to create a view and a model and pass this url of the iFrame to the view. How do i do that? Thanks.
Upvotes: 0
Views: 710
Reputation: 2726
// Controller
ViewBag.IframeUrl = theIframeUrl;
View("ViewName");
//View
<iframe src="@ViewBag.IframeUrl"></iframe>
This is the simplest way. Depending on your problem you may want to use a model / viewmodel.
Upvotes: 1