从 AJAX 工具包选项卡面板中删除边框

发布于 2024-11-16 19:04:56 字数 3744 浏览 8 评论 0原文

我在使用 AjaxControlTollkit 选项卡时遇到问题。我想删除选项卡的边框,因为我并不真正需要它们(显示原因)。这是我的代码的简化示例:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default-Defaut.aspx.cs"
    Inherits="TinTan._Default" MasterPageFile="~/CLF20.Master" Culture="auto"
    UICulture="auto" EnableEventValidation="false" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" 
        EnablePageMethods="True" CombineScripts="True">
        <Services>
            <asp:ServiceReference Path="AutoComplete.asmx" />
        </Services>
     </asp:ToolkitScriptManager>
    <div>
    <!--tabs in which all the options will be avaible (using AJAX for faster respone)-->
    <asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Always">
    <Triggers>
        <asp:PostBackTrigger ControlID="btnPostBack" />
    </Triggers>
    <ContentTemplate>
        <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" OnClientActiveTabChanged="CheckActiveTab" OnActiveTabChanged="TabContainer_ActiveTabChanged" 
             BorderWidth="0px" >

<asp:TabPanel ID="tabAddTan" runat="server" Visible="false">
                <HeaderTemplate>
                    Add Tan (Admin)
                </HeaderTemplate>
                <ContentTemplate>
                    <div class="divTable">
                        <div class="divRow">
                            <asp:Label ID="lblAddTanTitle" runat="server" Text="Add TAN" Font-Bold="true" Font-Size="Large"></asp:Label>
                        </div>
                    </div>
                    <asp:UpdatePanel ID="pnlAddTan" runat="server" UpdateMode="Always">
                        <ContentTemplate>
                            <div class="divTable">
                                <div class="divRow">

                                    <asp:AsyncFileUpload OnUploadComplete="UploadComplete" runat="server" OnUploadedComplete="UploadComplete"
                                        ID="AsynchAddTan" />
                                </div>
                                <div class="divRow">
                                    <asp:Button ID="btnAddTanClick" runat="server" Text="Upload File" OnClick="UploadComplete" />
                                </div>
                            </div>

                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>
</asp:TabContainer>

这是我尝试的内容和结果:

  • 使用 BorderWidth="0px"、BorderStyle="none"、BorderColor="white" 属性:它不起作用,边框未更改
  • 添加 CSS 类并将其链接到具有 CssClass 属性的 TabContainer: 它删除了选项卡的所有样式,选项卡标题只是纯文本。边框没有想到

这里是我使用的CSS:

<style type="text/css">
        .AjaxBorder .ajax__tab_body
        {
            border:0;
        }
        .AjaxBorder .ajax__tab_tab 
        {
            height:13px;
            padding:4px;
            margin:0;
            background:url(Tabs/tab.gif) repeat-x;
        }
    </style>

它位于母版页中。当我尝试使用 CssClass 将其链接到 AjaxTabContainer 时,.Ajaxborder 类位于 VS2010 为我提供的选择中。

  • 使用 style 属性并将 border:0 none 白色;其中:与第一次尝试的结果相同,ajax 选项卡没有更改。

我最接近目标的是第二个选择。但我不明白为什么当我只是告诉他删除边框时它会删除选项卡的所有样式。我也不明白为什么其他选项不对选项卡执行任何操作。

谢谢 雨果

I'm having a problem with the AjaxControlTollkit Tabs. I want to remove the borders of the tabs since I do not really need them (display reasons). Here is a simplified sample of my code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default-Defaut.aspx.cs"
    Inherits="TinTan._Default" MasterPageFile="~/CLF20.Master" Culture="auto"
    UICulture="auto" EnableEventValidation="false" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" 
        EnablePageMethods="True" CombineScripts="True">
        <Services>
            <asp:ServiceReference Path="AutoComplete.asmx" />
        </Services>
     </asp:ToolkitScriptManager>
    <div>
    <!--tabs in which all the options will be avaible (using AJAX for faster respone)-->
    <asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Always">
    <Triggers>
        <asp:PostBackTrigger ControlID="btnPostBack" />
    </Triggers>
    <ContentTemplate>
        <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" OnClientActiveTabChanged="CheckActiveTab" OnActiveTabChanged="TabContainer_ActiveTabChanged" 
             BorderWidth="0px" >

<asp:TabPanel ID="tabAddTan" runat="server" Visible="false">
                <HeaderTemplate>
                    Add Tan (Admin)
                </HeaderTemplate>
                <ContentTemplate>
                    <div class="divTable">
                        <div class="divRow">
                            <asp:Label ID="lblAddTanTitle" runat="server" Text="Add TAN" Font-Bold="true" Font-Size="Large"></asp:Label>
                        </div>
                    </div>
                    <asp:UpdatePanel ID="pnlAddTan" runat="server" UpdateMode="Always">
                        <ContentTemplate>
                            <div class="divTable">
                                <div class="divRow">

                                    <asp:AsyncFileUpload OnUploadComplete="UploadComplete" runat="server" OnUploadedComplete="UploadComplete"
                                        ID="AsynchAddTan" />
                                </div>
                                <div class="divRow">
                                    <asp:Button ID="btnAddTanClick" runat="server" Text="Upload File" OnClick="UploadComplete" />
                                </div>
                            </div>

                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>
</asp:TabContainer>

Here is what I tried and the results:

  • Using the BorderWidth="0px", BorderStyle="none", BorderColor="white" properties: it did not work, the borders were unchanged
  • adding a CSS class and linking it the the TabContainer with the CssClass property: It removed ALL the style of the tabs, the tabs Header were only plain text. The borders were not there thought

Here is the CSS I used:

<style type="text/css">
        .AjaxBorder .ajax__tab_body
        {
            border:0;
        }
        .AjaxBorder .ajax__tab_tab 
        {
            height:13px;
            padding:4px;
            margin:0;
            background:url(Tabs/tab.gif) repeat-x;
        }
    </style>

It is situated in teh master page. When I was trying to link it to the AjaxTabContainer with CssClass, the .Ajaxborder class was in the choices VS2010 was offering me.

  • Using the style property and putting border:0 none white; in it: same result as the 1st try, there was no changes to the ajax tabs.

The closest I have been to my goal was the 2nd option. But I do not understand why it removes all the style of the tabs when I am only telling him to remove the borders. I also do not understand why the other options do not do a single thing to the tabs.

Thanks
Hugo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

千寻… 2024-11-23 19:04:56

在应用程序中我通过以下方式应用了CSS
在脚本管理器之后添加一个虚拟选项卡容器

使用的样式
.ajax__tab_xp .ajax__tab_tab
{
高度:21px;
对 tabcontainer 使用 cssclass="ajax__tab_xp" ..

.ajax__tab_xp .ajax__tab_header
{
     border:0;
     border-top:0;
     border-top-color:White;

}   

它对我有用

如果有用的话也请浏览此链接 http://forums.asp.net/t/1300660.aspx/1

In application i applied the CSS in the following way
add one dummy tabcontainer after script manager

Styles used
.ajax__tab_xp .ajax__tab_tab
{
height: 21px;
}

.ajax__tab_xp .ajax__tab_header
{
     border:0;
     border-top:0;
     border-top-color:White;

}   

use cssclass="ajax__tab_xp" for tabcontainer..It works for me

Also please go through this link if it is useful http://forums.asp.net/t/1300660.aspx/1

最偏执的依靠 2024-11-23 19:04:56

用于

outline-style:none;

删除活动选项卡上的框

outline-color:Blue;

获得蓝色,而不是 ajaxcontroltoolkit 演示上那种令人讨厌的棕色和蓝色

... .ajax__tab_active .ajax__tab_tab {background:url('tab-active-verticalleft_b.gif')重复-x;大纲样式:无}

use

outline-style:none;

to remove the box on the active tab

or

outline-color:Blue;

to get a blue color, not that nasty brownish with blue on ajaxcontroltoolkit demo

... .ajax__tab_active .ajax__tab_tab {background:url('tab-active-verticalleft_b.gif') repeat-x; outline-style:none}

蓝眼睛不忧郁 2024-11-23 19:04:56

添加!重要

<style type="text/css">
        .AjaxBorder .ajax__tab_body
        {
            border:0 !important;
        }
        .AjaxBorder .ajax__tab_tab 
        {
            height:13px;
            padding:4px;
            margin:0;
            background:url(Tabs/tab.gif) repeat-x;
        }
    </style>

add !important

<style type="text/css">
        .AjaxBorder .ajax__tab_body
        {
            border:0 !important;
        }
        .AjaxBorder .ajax__tab_tab 
        {
            height:13px;
            padding:4px;
            margin:0;
            background:url(Tabs/tab.gif) repeat-x;
        }
    </style>
多孤肩上扛 2024-11-23 19:04:56

只需将轮廓设置为0即可;

我就是这样做的

.MyTabStyle .ajax__tab_active .ajax__tab_tab
{
     outline:0;    
}

Simply set outline to 0;

This is how I do it

.MyTabStyle .ajax__tab_active .ajax__tab_tab
{
     outline:0;    
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文