|
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// Summary description for MyImageButton
/// </summary>
public class MyImageButton:Label
{
//private string _url;
public MyImageButton(string imgUrl,string Url)
:base()
{
//this.ImageUrl = imgUrl;
//_url = Url;
this.Text = "<a href='"+Url+"'><img src='"+imgUrl+"' alt='' style='border:0px'/></a>";
}
public MyImageButton(string imgUrl, string Url,string alt)
: base()
{
if (Url.Trim()!="")
this.Text = "<a href='" + Url + "'><img src='" + imgUrl + "' alt='" + alt + "' style='border:0px'/></a>";
else
this.Text = "<img src='" + imgUrl + "' alt='" + alt + "' style='border:0px'/>";
}
/* protected override void OnClick(ImageClickEventArgs e)
{
base.OnClick(e);
Page.Response.Redirect(_url,true);
}*/
}
/*public class MyImageButton:ImageButton
{
private string _url;
public MyImageButton(string imgUrl,string Url)
:base()
{
this.ImageUrl = imgUrl;
_url = Url;
}
public MyImageButton(string imgUrl, string Url,string alt)
: base()
{
this.ImageUrl = imgUrl;
_url = Url;
AlternateText = alt;
}
protected override void OnClick(ImageClickEventArgs e)
{
base.OnClick(e);
Page.Response.Redirect(_url,true);
}
}*/
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.