473,587 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PreRender event not firing on ImageButton

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
1 2487
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(Eve ntArgs e)
{
PreRender(this, e);
this.ToolTip = "Render";
base.OnPreRende r(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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1992
by: Dan | last post by:
I have an aspx page with a form on it. There are a couple of textboxes and an ImageButton. The page is loaded from another page using Server.Transfer. When I click on the ImageButton, the Page_Load event immediately fires on the codebehind page and then click event fires. When this happens, the Page.IsPostBack property is true in the...
5
1957
by: csgraham74 | last post by:
Hi guys, I posted regarding this issue the other day but i still dont have an answer to my problem. Basically i have imported asp.net pages from dreamweaver into visual studio. Ive added a few controls that ive copied in from another asp.net page that i built within visual studio. The problem is that the asp:button does not fir an event...
5
10360
by: Verde | last post by:
This is admittedly an apparently odd request... but please indulge me if you don't mind: Suppose I have two <asp:Button.../> on a page (Button1 and Button2). User clicks Button1 and triggers a PostBack. How can I then fire the click event of Button2 during the same PostBack? I know this seems like a totally bad situation I'm creating out...
3
9662
by: John Scott | last post by:
Hey I've got an odd problem here. I have two user controls on a single page. Here is the flow of my page Page(OnLoad) UC1(OnPreRender) UC2(OnPreRender) Page(ButtonClick) UC1(OnPreRender) UC2....NOTHING
1
3078
by: Mark Gilkes | last post by:
I have a DataGrid which I am adding to the page dynamically at the Init stage of the page load. The DataGrid has AutoGenerateColumns turned off, has BoundColumns and is bound to a DataView for its’ data source. I have also added a TemplateColumn which is defined in a derived class and contains an ImageButton. The derived TemplateColumn class...
0
1313
by: Daniel | last post by:
I've created a custom control including some Literal ( constructed with html markup) and an ImageButton firing event ( add a vote ). public event VoteCommandEventHandler VoteCommand; protected override void CreateChildControls() { LiteralControl ltrBeforeVote = new LiteralControl(buildMarkupBeforeVoteButton());...
1
2510
by: =?Utf-8?B?Sm9zZW1h?= | last post by:
Hi, I have a form runat server with two asp:textbox and one asp:imagebutton Im trying to debug a problem when the user clicks in the imagebutton but the event its not firing in firefox. I would need to know what could be the cause. In internet explorer works fine. Thanks a lot.
2
6354
by: tshad | last post by:
In VS 2008, I have 2 pages, one aspx page and one ascx page. The PreRender event is not firing on the Contol page. The aspx page starts out: <%@ Page Language="VB" AutoEventWireup="true" Trace="true" CodeFile="TakeSurveyTest.aspx.vb" Inherits="TakeSurveyTest" %> And the ascx page starts out:
0
1866
by: tshad | last post by:
In VS 2008, I have 2 pages, one aspx page and one ascx page. The PreRender event is not firing on the Contol page. The aspx page starts out: <%@ Page Language="VB" AutoEventWireup="true" Trace="true" CodeFile="TakeSurveyTest.aspx.vb" Inherits="TakeSurveyTest" %> And the ascx page starts out:
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.