当前位置: 代码迷 >> ASP.NET >> 怎么更改WebPart中partstyle默认的:style="padding:5px"
  详细解决方案

怎么更改WebPart中partstyle默认的:style="padding:5px"

热度:8363   发布时间:2013-02-25 00:00:00.0
如何更改WebPart中partstyle默认的:style="padding:5px"?
在webpart里面,我并没有定义partstyle的任何padding= "5 "值,可为什么他会自动生成style= "padding:5px; "呢:
  <td   class= "WebPartStyle "   cellspacing= "0 "   cellpadding= "0 "  
style= "border-collapse:collapse;padding:5px; ">
<table   cellpadding= "0 "   cellspacing= "0 ">
我设置了 <asp:WebPartZone   Padding= "0 ">   ,还是没有用,而 <PartStyle/> 中又没有padding属性.请问大家在哪里设置,可以把padding设为0px;?

/*----------------------------------------------------------------*/
在.CSS文件中,是这样定义的:
.WebPartStyle
{
  text-align:left;   width:250px;   padding:0px;
  }

/*----------------------------------------------------------------*/
在default.aspx中是这样定义的:
<asp:WebPartZone   ID= "WebPartZone1 "   title   runat= "server "   BorderWidth= "0px "  
HeaderText= " "   Padding= "0 ">
        <PartTitleStyle   CssClass= "WebPartTitle "   />
        <PartStyle   CellSpacing= "0 "   CellPadding= "0 "   CssClass= "WebPartStyle "/>
        <ZoneTemplate>
        <uc2:themectrl   ID= "Themectrl1 "   runat= "server "   Title= "   "   />
        </ZoneTemplate>
        </asp:WebPartZone>

/*----------------------------------------------------------------*/
在ctrpanel\themectrl.ascx中是这样定义的.
<%@   Control   Language= "C# "   AutoEventWireup= "true "  
CodeFile= "themectrl.ascx.cs "   Inherits= "ctrpanel_themectrl "   %>
<table   cellpadding= "0 "   cellspacing= "0 ">
        <tr>
                <td   class= "tabletop "> 主题 </td>
        </tr>
        <tr>
                <td   class= "tablect ">
                        <table   cellpadding= "0 "   cellspacing= "10 ">
                                <tr> <td>
                                        <a   href= "# "> 选择 </a>
                                </td> </tr>
                        </table>
                </td>
        </tr>
        <tr>
                <td   class= "tablebtm "> </td>
        </tr>
</table>

/*----------------------------------------------------------------*/
在生成的HTML代码如下:
<table   cellspacing= "0 "   cellpadding= "0 "   border= "0 "  
  相关解决方案