开发者

change position panel

开发者 https://www.devze.com 2023-02-17 06:57 出处:网络
<table> <tr><td> <asp:Panel ID=\"PanelButtomEnter\" runat=\"server\" > </asp:Panel>
<table> 
  <tr><td>  
     <asp:Panel ID="PanelButtomEnter" runat="server" >
      </asp:Panel>
  </tr></td>
</table>

 protected void 开发者_StackOverflowbrtnEnterProduct_Click(object sender, EventArgs e)
 {
    //how can change position panel
 }

how can change position panel on page.


First, you have </tr></td> but it should be </td></tr>.

Second, while applying style.top and style.left, you should also apply style.position="absolute", like this:

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

These 3 values should work.

I hope this helps.

See following MSDN articles.

WebControl.Style Property

CssStyleCollection.Add Method


The better approach will be using Styles. Try this code.

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

精彩评论

暂无评论...
验证码 换一张
取 消