开发者

change position 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜