开发者

show Select URL box for ClickImageURL in Custom ImageButton

I am making a custom ImageButton Control 开发者_开发知识库which has the option to show button clicked effect by adding onmouseup and onmousedown javascript code to change image URL. I have constructed the control and it has a ClickImageUrl to set the URL of image to be shown when button is clicked..

i wanted to know is there any way i can add a Select URL dialog box for my control just like the Dialog box for ImageUrl. is it even possible??? and if so how would i go about doing it...??

any help will be much appreciated.

EDIT: based on the answer by Arther i am able to show a Select Image URL diaolog box when i use it to set ClickImageUrl it shows a designer error as :

Error Rendering Control An unhandled exception has occured '~/images/7.jpg' cannot be set on property 'ClickImageUrl'

is it conflicting with the ImageUrl ???


If your talking about the VS Designer, then you have to decorate your Property with these Attributes:

public class CustomImageButton : System.Web.UI.WebControls.ImageButton
{
    [Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
    [UrlProperty]
    public string ClickImageUrl { get; set; }
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜