yirengirl (伊人) :
如果找到了能不能给我Mail一份:[email protected]
如果找到了能不能给我Mail一份:[email protected]
解决方案 »
- 三层架构网站发布问题?
- Paypal 支付返回页验证问题
- 一个关于页面回退的问题
- 视频上传和播放
- ASP.NET是百分百的面向经验编程,支持的顶
- 请大虾 给我一个例子 怎么连接到本机后台 sql server2000 中自带的 pubs 数据库 连接代码写在什么地方比较好?
- 现在CSDN的人越来越少了,怎么把asp.net的内容提交到asp中,问了好久都没有解决,详细请进。
- 请问我用SqlDataAdapter读取的数据 怎么来判断读取的数据中的值?
- 电子商务网站实现“客户端处理” 的问题
- HttpWebRequest抓取网页,ip被ban何解
- 怎么样给下载加上计数
- 我在我的2000server上装了Active Directory 后,在运行我的asp.net 报错,是不是active Directory的站点和默认站点有冲突呢?怎么能解决
我只有ASP.NET高级编程
2.需要自己写设计器代码 具体我也没有写过:(
csdn上有关这方面高手不多啊.......
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;namespace HenryFan.WebControls
{
/// <summary>
/// WebCustomControl1 的摘要说明。
/// </summary>
[DefaultProperty("Text"),
ToolboxData("<{0}:ImageButton1 runat=server></{0}:ImageButton1>")]
public class ImageButton : System.Web.UI.WebControls.WebControl, IPostBackEventHandler
{
public ImageButton(): base(HtmlTextWriterTag.Div )
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public String Text
{
get
{
return (String) ViewState["Text"];
} set
{
ViewState["Text"] = value;
}
}
public String LeftImage
{
get
{
return (String) ViewState["LeftImage"];
} set
{
ViewState["LeftImage"] = value;
}
}
public int LWidth
{
get
{
if(ViewState["LWidth"]==null)
return 0;
return (int)ViewState["LWidth"];
} set
{
ViewState["LWidth"] = value;
}
}
public int RWidth
{
get
{
if(ViewState["RWidth"]==null)
return 0;
return (int)ViewState["RWidth"];
} set
{
ViewState["RWidth"] = value;
}
}
public int BHeigth
{
get
{
if(ViewState["BHeigth"]==null)
return 0;
return (int)ViewState["BHeigth"];
} set
{
ViewState["BHeigth"] = value;
}
}
public int ButtonWidth
{
get
{
if(ViewState["ButtonWidth"]==null)
return 0;
return (int)ViewState["ButtonWidth"];
} set
{
ViewState["ButtonWidth"] = value;
}
}
public String RightImage
{
get
{
return (String) ViewState["RightImage"];
} set
{
ViewState["RightImage"] = value;
}
}
public String ClientImage
{
get
{
return (String) ViewState["ClientImage"];
} set
{
ViewState["ClientImage"] = value;
}
}
public event EventHandler Click;
protected virtual void OnClick(EventArgs e)
{
if (Click != null)
{
Click(this, e);
}
}
public void RaisePostBackEvent(string eventArgument)
{
OnClick(new EventArgs());
}
protected override void AddAttributesToRender(HtmlTextWriter writer)
{
base.AddAttributesToRender(writer);
writer.AddAttribute(HtmlTextWriterAttribute.Style,"cursor:hand");
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "javascript:" + Page.GetPostBackEventReference(this));
}
protected override void RenderContents(HtmlTextWriter writer)
{
string ButtonText="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\""
+"style=\"border-collapse: collapse\" bordercolor=\"#111111\""
+" height=\"22\">"
+"<tr>"
+"<td width=\"6\" background=\""+this.LeftImage+"\"></td>"
+"<td width=\""+this.ButtonWidth.ToString()+"\" background=\""+this.ClientImage +"\"><font size=\"2\">"
+"<p align=\"center\">"+this.Text
+"</font></td>"
+"<td width=\"6\"background=\""+this.RightImage+"\">"
+"</td>"
+"</tr>"
+"</table>";
writer.Write(ButtonText);
}
}
}
还没完成,是一个自定义的WEB按钮