Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Teemu Keiski #1
Re: Custom ImageButton will not Fire on button click..HELP! Thanks. :)
Hi,
it is because nothing actually calls your custom OnClick method (it is the
original OnClick called at IPostBackEventHandler.RaisePostBackEvent
implementation of base ImageButton). Easier would be just overriding the
OnClick method base class provides and from there raise this custom event,
without calling base class method when original Click event is not raised,
but this certainly depends what you want to do.
--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
[url]http://blogs.aspadvice.com/joteke[/url]
"Troy" <anonymous@discussions.microsoft.com> wrote in message
news:8EA587B8-06B7-4DE2-8DB8-E8FBCE907645@microsoft.com...
I have a custom control that inherits from ImageButton. When I click the
button it does not fire. Any ideas? Here's what I have as of now:
Public Class myNavEventArgs
Inherits EventArgs
....some properties.
End Class
<Serializable(), ToolboxData("<{0}:myImageButton
runat=server></{0}:myImageButton>")> Public Class myImageButton
Inherits System.Web.UI.WebControls.ImageButton
Implements ISerializable
Public Shadows Event Click(ByVal sender As Object, ByVal e As
myNavEventArgs)
Protected Shadows Sub OnClick(ByVal e As myNavEventArgs)
RaiseEvent Click(Me, e)
End Sub
End Class
Thanks for all your help.
Troy
Teemu Keiski Guest
-
User control ImageButton won't fire
I have a very simple user control containing a textbox and imagebutton. When the button is clicked a new win opens to search the database, and the... -
Button-click fire before or after page_load?
Hi - thanks for the help in this group so far. Regarding the click event of a link_button (created within a table and added to a placeholder at... -
ImageButton in template column in edit mode don't fire event
Hi, I hava a datagrid with template column, and have one colums for for edit event (edit, delete, update, cancel) but whem i put datagrid in edit... -
Fire ItemCommand when programatically added Imagebutton is clicked
I have the exaxct same problem and was hoping that someone could look at the code and help me with what I am missing. It appears correct, but the... -
ImageButton Event won't fire inside Template column of DataGrid
I have a custom datagrid control created with CreateChildControls() My Image Button Event will not fire so I cannot raise it to the webform. ...



Reply With Quote

