What I have now is a table with one row with three cells. Each cell has some
"pretty" background in it, and in the center cell there is some text, or, if
need be, a real button. It's essentially a customized button that should act
like a button control.
I could in theory inherit button and override render, but I think that still
leaves me with a problem - this control needs to raise a click event
server-side in its containing form. Yes, I can manually raise the click
event in with OnClick, but from where do I fire that? A contained button's
click event? That doesn't work, the control - whether it be inherited from
Control or Button - refuses to handle it.
Please tell me about postback hookup code.
Paul
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:ea*************@TK2MSFTNGP10.phx.gbl...
PJ6,
Without knowing what your control contains this is difficult... But, a
short answer might be to do the following:
Would you be able to inherit from a button instead of just a generic
control? Then you'd have all the postback hookup code inherent in the
object instead of having to create it yourself...
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"PJ6" <no****@nowhere.net> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl... I've added a button to a class inheriting from System.Web.UI.Control and
want to handle (pass on) its click event to the page that contains it.
Coming from a WinForms background, I thought this (below) would work. It
doesn't. A break point on btn_Click isn't even hit.
Is there a way to do this?
Paul
Private Sub btn_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn.Click
Me.OnClick(New EventArgs)
End Sub
Public Event Click(ByVal sender As Object, ByVal e As EventArgs)
Protected Overridable Sub OnClick(ByVal e As EventArgs)
RaiseEvent Click(Me, e)
End Sub