twitter-bootstrap Bootstrap 是否与 ASP.NET Telerik 控件兼容?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13044492/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 15:35:45  来源:igfitidea点击:

Is Bootstrap compatible with ASP.NET Telerik controls?

asp.nettwitter-bootstraptelerik

提问by Mubarak

I have developed a site using ASP.NET Telerik controls and components. Its not working (positioning, screen resolution) fine on mobiles devices (scaling across resolutions).

我使用 ASP.NET Telerik 控件和组件开发了一个站点。它在移动设备上无法正常工作(定位、屏幕分辨率)(跨分辨率缩放)。

I decided to integrate bootstrap in my site but bootstrap-responsive styles are not adjusting what I need.

我决定将引导程序集成到我的网站中,但引导程序响应样式并没有调整我需要的内容。

Has anyone tried bootstrap with asp.net Telerik components? are both compatible?

有没有人尝试过使用 asp.net Telerik 组件进行引导?两者兼容吗?

Any suggestion/proper guide ?

任何建议/适当的指南?

回答by Boxnumber

There are incompatibilities between some frameworks like Bootstrap and Telerik. The main problem is different frameworks make use of CSS style names and if two different frameworks use the same name, there will be conflicts. I noticed this with the latest version of Bootstrap (3.0) and the latest version of Telerik, in some Telerik controls the checkbox formatting was over-ridden by Bootstrap. Unfortunately it's very tricky to fix, you need to customize it to a point that it would be easier not to use the framework at all.

Bootstrap 和 Telerik 等一些框架之间存在不兼容。主要问题是不同的框架使用 CSS 样式名称,如果两个不同的框架使用相同的名称,则会出现冲突。我在最新版本的 Bootstrap (3.0) 和最新版本的 Telerik 中注意到了这一点,在某些 Telerik 控件中,Bootstrap 覆盖了复选框格式。不幸的是,修复它非常棘手,您需要对其进行自定义,以便根本不使用该框架会更容易。

回答by rdmptn

If you need bootstrap to make your page responsive, you can use RadPageLayout: http://www.telerik.com/products/aspnet-ajax/responsive-page-layout.aspx. Thus, you can drop Bootstrap. Here is its documentation: http://www.telerik.bg/help/aspnet-ajax/page-layout-overview.html. In case you are using some styling it provides, perhaps RadFormDecorator can help you style the forms you have: http://demos.telerik.com/aspnet-ajax/formdecorator/examples/overview/defaultcs.aspx.

如果您需要引导程序使您的页面响应,您可以使用 RadPageLayout:http: //www.telerik.com/products/aspnet-ajax/responsive-page-layout.aspx。因此,您可以删除 Bootstrap。这是它的文档:http: //www.telerik.bg/help/aspnet-ajax/page-layout-overview.html。如果您正在使用它提供的一些样式,也许 RadFormDecorator 可以帮助您设置表单的样式:http://demos.telerik.com/aspnet-ajax/formdecorator/examples/overview/defaultcs.aspx 。

回答by Ignacio

If you let me do a suggestion, you can check for MDBootstrap (it′s a front-end framework built on top of Bootstrap). There you will find an articlewith free ASP.NET templates.

如果你让我做一个建议,你可以检查MDBootstrap(它是一个建立在Bootstrap之上的前端框架)。在那里您会找到一篇包含免费 ASP.NET 模板的文章

回答by MD TAHMID HOSSAIN

Link Says

链接说

It depends on what you're trying to accomplish. In general, bootstrap

2.0 is a lot easier to work with along with Telerik because they style less of the default elements, like . In 2.0, they require you to add some class to a element, which means that they don't try to style a Telerik grid, for example. This makes it look better.

What you won't get is a "Bootstrap themed" version of the Telerik controls. Continuing with the Telerik grid example, if you use that in conjunction with Bootstrap it will look like a Telerik grid, not a Bootstrap table, with it's nice pager buttons, etc. That will take a lot of work to change, and I don't recommend it. Telerik emits html with its own CSS class names and mapping that back to Bootstrap would be a chore. I've found, actually, that with Bootstrap I use a lot less of Telerik than I did before, and just use more straight html + Bootstrap.

If you do decide to integrate Telerik in your site, I recommend the Telerik "Simple" theme, which seems to match Bootstrap's default colors best.

这取决于您要实现的目标。一般来说,引导程序

2.0 与 Telerik 一起使用要容易得多,因为它们样式较少的默认元素,如 . 例如,在 2.0 中,它们要求您向元素添加一些类,这意味着它们不会尝试设置 Telerik 网格的样式。这使它看起来更好。

您不会得到 Telerik 控件的“引导程序主题”版本。继续使用 Telerik 网格示例,如果您将它与 Bootstrap 结合使用,它将看起来像 Telerik 网格,而不是 Bootstrap 表格,带有漂亮的寻呼按钮等。这将需要大量工作才能更改,我不不推荐它。Telerik 使用自己的 CSS 类名称发出 html,并将其映射回 Bootstrap 将是一件苦差事。我发现,实际上,在 Bootstrap 中,我使用的 Telerik 比以前少了很多,只是使用了更直接的 html + Bootstrap。

如果您决定将 Telerik 集成到您的站点中,我建议使用 Telerik“Simple”主题,它似乎与 Bootstrap 的默认颜色最匹配。

回答by Crismogram

RadImageEditor icons are hidden when I use bootstrap.

当我使用引导程序时,RadImageEditor 图标是隐藏的。

So I must say that it is not 100% compatible.

所以我必须说它不是 100% 兼容的。

回答by Ying Chang

Yes, I recently build ASP.NET 2013 Web Application using Bootstrap and Telerik ASP.NET Ajax version Q2 2015 and .NET Framework 4.5.1 . During my implementation of this project, I had one issue: ? One issue is that when I use the RadAjaxManager, I got this error:

是的,我最近使用 Bootstrap 和 Telerik ASP.NET Ajax 版本 Q2 2015 和 .NET Framework 4.5.1 构建了 ASP.NET 2013 Web 应用程序。在我实施这个项目的过程中,我遇到了一个问题:?一个问题是,当我使用 RadAjaxManager 时,出现以下错误:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

无法修改 Controls 集合,因为该控件包含代码块(即 <% ... %>)。

? To fix this, I wrapped the code section with the control.

? 为了解决这个问题,我用控件包装了代码部分。