怎样在后台设置控件的长短,大小等等???

解决方案 »

  1.   

    unction Change_Style(font) 
      { 
       
       
      font.style.textAlign="left"; 
      font.style.color="#ff0033"; 
      font.style.fontWeight="bold"; 
      font.size=17; 
       
       
      } private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    this.TextBox1 .Attributes .Add ("onchange","Change_Style(this)");
    }
      

  2.   

    function Change_Style(font)
    {
    font.style.textAlign="left";
    font.style.color="#ff0033";
    font.style.fontWeight="bold";
    font.size=17;
    } private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    this.TextBox1 .Attributes .Add ("onchange","Change_Style(this)");
    }
      

  3.   

    继承自 WebControl 的对象都有 Width, Height属性。
      

  4.   

    注意,后台设置的width,height属性,不能直接写数值,必须如下写;
    this.Button2.Width = Unit.Pixel(100);