简体   繁体   English

ASP:NET MVC:如何在一个页面中呈现两种样式而没有任何 CSS 类重叠?

[英]ASP:NET MVC: How can I render two styles in one page without any overlaps of CSS classes?

I am working on a web based application that generates documents with some data.我正在开发一个基于 Web 的应用程序,该应用程序生成带有一些数据的文档。 I have a new feature in the document generator, you can paste an Atlassian Confluence (in our company we use this as wiki) link in a textbox and on save the content from this specific page will appear in the document.我在文档生成器中有一个新功能,您可以将 Atlassian Confluence(在我们公司中,我们将其用作 wiki)链接粘贴到文本框中,然后保存该特定页面的内容将出现在文档中。

1. Problem: I have no possibility to get row data from the API of Atlassian Confluence without CSS-Classes. 1. 问题:如果没有 CSS-Classes,我无法从 Atlassian Confluence 的 API 中获取行数据。

2. Problem: I use in the document generator Bootstrap 3 and Atlassian Confluence use some Bootstrap classes too. 2. 问题:我在文档生成器中使用了 Bootstrap 3,Atlassian Confluence 也使用了一些 Bootstrap 类。 This means: The Atlassian Confluence stylesheet recolor and resize the element on my page and I cannot create a new stylesheet for the content from Confluence because there are some special things and I don't have the time to do that.这意味着:Atl​​assian Confluence 样式表重新着色并调整我页面上元素的大小,我无法为 Confluence 的内容创建新样式表,因为有一些特殊的事情,我没有时间这样做。

Question : Is there any possibility or workaround to fix this problem with the options of ASP.NET and Razor?问题:是否有任何可能性或解决方法可以使用 ASP.NET 和 Razor 选项解决此问题?

Solution for my Case:我的案例的解决方案:

I created a new cshtml Page called "WikiContent".我创建了一个名为“WikiContent”的新cshtml页面。 In this Page I render the Content from Attlasian Confluence with the Styling from Confluence.在此页面中,我使用 Confluence 的样式渲染 Attlasian Confluence 的内容。 In my Document Page I created an <iframe> which renders the Page "WikiContent" with some Parameters.在我的文档页面中,我创建了一个<iframe> ,它使用一些参数呈现页面“WikiContent”。

I used the Answer from this Question to style and resize the <iframe> with JavaScript.我使用这个问题的答案来设计和调整<iframe>与 JavaScript 的大小。 I also added a Width of 100% to the <iframe> .我还在<iframe>添加了 100% 的宽度。

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

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