简体   繁体   English

如何在iframe中加载View?

[英]How to load View in iframe?

I want to load a (M V C) View in an iframe. 我想在iframe中加载(M V C)视图。 But the view which i am trying to load in an iframe does not contain any action , i added it manually. 但是我试图在iframe中加载的视图不包含任何操作,因此我手动添加了它。 For clearity suppose 为了清楚起见,假设

 Index.cshtl => View

 public ActionResult Index() => Action of index view
 {
  return View()
 }                          This view loads perfectly in iframe

Now 现在

 Test.cshtml => View

 No action for this view   & I want to load this view in iframe. 

I found the solution , we just have to send the requet to the Action from where the Test view is called like : 我找到了解决方案,我们只需要将记录发送到Test viewAction

  <iframe src="/controllername/actionname?viewname"></iframe>

this setup is in my case may be in your case it is different. 就我而言,此设置可能与您的情况有所不同。 I hope it helps. 希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM