2。怎么获得控件的高度,宽度等,在宽度,高度没有设置的情况下
   对于IMAGEBUTTON,有人给了答案:System.Drawing.Image logo = System.Drawing.Image.FromFile(Server.MapPath(ImageButton1.ImageUrl))其他的不知道了

解决方案 »

  1.   

    1.要添加一控件的属性:如下:
    [Category("Appearance"),
    Editor(typeof(System.Web.UI.Design.ImageUrlEditor), typeof(UITypeEditor)),
    PersistenceMode(PersistenceMode.Attribute),Description("子项图像地址"),]
    public string ImageUrl
    {
    get
    {
    Object obj = ViewState["Image"];
    return (obj == null) ? String.Empty : (string)obj;
    } set
    {
    ViewState["Image"] = value;
    }
    }
    其中Editor就是路径编辑对话框。
    2。Unit Width = Unit.Parse(this.Style["width"])
    高度同理,Style中的width要小写。
      

  2.   

    http://community.csdn.net/Expert/topic/3083/3083179.xml?temp=.1471216
      

  3.   

    Category("Appearance"),
    Editor(typeof(System.Web.UI.Design.ImageUrlEditor), typeof(UITypeEditor)),
    PersistenceMode(PersistenceMode.Attribute),Description("子项图像地址"),]
    public string ImageUrl
    {
    get
    {
    Object obj = ViewState["Image"];
    return (obj == null) ? String.Empty : (string)obj;
    } set
    {
    ViewState["Image"] = value;
    }
    }
    其中Editor就是路径编辑对话框。
    2。Unit Width = Unit.Parse(this.Style["width"])
    高度同理,Style中的width要小写。
     sneak(sneak) ( 
    试过没有呀
    你试试呢??
    不行??
    你说的,早就用过了