【问题标题】:change position panel改变位置面板
【发布时间】:2011-07-16 09:21:27
【问题描述】:
<table> 
  <tr><td>  
     <asp:Panel ID="PanelButtomEnter" runat="server" >
      </asp:Panel>
  </tr></td>
</table>

 protected void brtnEnterProduct_Click(object sender, EventArgs e)
 {
    //how can change position panel
 }

如何更改页面上的位置面板。

【问题讨论】:

    标签: asp.net html css stylesheet


    【解决方案1】:

    更好的方法是使用样式。试试这个代码。

    this.PanelButtomEnter.Styles.Add("Top","100");
    this.PanelButtomEnter.Styles.Add("Left","100");
    

    【讨论】:

    • 那我觉得你做不到。
    【解决方案2】:

    首先,您有&lt;/tr&gt;&lt;/td&gt;,但它应该是&lt;/td&gt;&lt;/tr&gt;

    其次,在申请style.topstyle.left的同时,还应该申请style.position="absolute",像这样:

    this.PanelButtomEnter.Style.Add("position","absolute");
    this.PanelButtomEnter.Style.Add("top","100px");
    this.PanelButtomEnter.Style.Add("left","100px");
    

    这 3 个值应该有效。

    我希望这会有所帮助。

    请参阅以下 MSDN 文章。

    WebControl.Style Property

    CssStyleCollection.Add Method

    【讨论】:

      猜你喜欢
      • 2013-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-19
      • 2012-03-14
      • 1970-01-01
      • 1970-01-01
      • 2017-04-17
      相关资源
      最近更新 更多