[英]Embed another html page in an existing ASP.NET MVC page
I've got over a decade of C# desktop application development under my belt but I'm new to ASP.NET MVC and my terminology may not be correct so i'll apologize ahead of time.我有十多年的 C# 桌面应用程序开发经验,但我是 ASP.NET MVC 的新手,我的术语可能不正确,所以我会提前道歉。
I've been working on an ASP.NET MVC 4 site that has jQuery 1.4 and bootstrap 3 as well as a lot of CSS customization.我一直在一个 ASP.NET MVC 4 站点上工作,该站点具有 jQuery 1.4 和 bootstrap 3 以及许多 CSS 自定义。 I've been trying to implement a feature and I've been able to do it separately with bootstrap 4 but when I copy the code over and render it in a Partial view, it turns out bad .我一直在尝试实现一个功能,我已经能够使用 bootstrap 4 单独完成它,但是当我复制代码并在 Partial 视图中呈现它时,结果是bad 。
I've spent a lot of time trying to figure out why it's displaying so poorly and I've realized that between the bootstrap 3 and 4 incompatibilities and all of the CSS customization the site has, it's almost infeasible to use this approach.我花了很多时间试图弄清楚为什么它的显示如此糟糕,并且我意识到在引导程序 3 和 4 不兼容以及站点具有的所有 CSS 自定义之间,使用这种方法几乎是不可行的。
Then I thought that I could just make all of my style
changes inline but that doesn't make things very maintainable and is apparently frowned upon.然后我想我可以让我的所有style
更改都内联,但这不会使事情非常易于维护并且显然不受欢迎。
With that being said, I've seen a number of posts about the usage of IFrame and it looks appealing but I have concerns.话虽如此,我已经看到许多关于 IFrame 使用的帖子,它看起来很吸引人,但我有顾虑。
cshtml
page into the IFrame?我可以将对象从主cshtml
页面传递到 IFrame 中吗?row
class to bs4-row
.例如:将row
类重命名为bs4-row
。 As you won't need all the bs4 library to style your code, you only need to rename and compile the files you need, like: _grid.scss.因为你不需要所有的 bs4 库来设计你的代码,你只需要重命名和编译你需要的文件,比如:_grid.scss。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.