By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,949 Members | 1,632 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,949 IT Pros & Developers. It's quick & easy.

PreRender event not firing on ImageButton

P: n/a
Does anyone know if there is a known bug or workaround, or other solution to
this problem?

I have a page with several imagebutton server controls and needed to
handle the PreRender event in C#. In all my tests, on several pages and
circumstances, the Init and PreRender events never fire for the image
button.

If I add a regular button server control, or several regular button server
controls, and the PreRender and Init events fire as expected for the regular
button controls.

Dale
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

It's a known bug.

if you want to workaround it create new custom control derived from
ImageButton. override the onPreRender method. I add a sample control
code :

public class MyImageButton : ImageButton
{
public new event EventHandler PreRender;
public MyImageButton() : base()
{
//
// TODO: Add constructor logic here
//

}
protected override void OnPreRender(EventArgs e)
{
PreRender(this,e);
this.ToolTip = "Render";
base.OnPreRender(e);
}
}

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.