Home All Groups Group Topic Archive Search About

HtmlImage and asp:Image servent onclick event

Author
24 Dec 2005 12:46 AM
RKT
(CSharp, NET2.0)

Is there any way to EITHER:

1. Programmatically add a server onclick() event hander to the 'HtmlImage'
HtmlControl control?

OR

2. Programmatically preempt a 'Image' WebControl from invoking a postback?

I'll spare you the 'why' I need to do this, but (hint) if I could derive a
base class using a template arg (C++), problem would be solved...

Author
24 Dec 2005 1:34 AM
Karl Seguin
No to both.

You can create a custom server control that inherits from either and
implements the functionality you want.

Also, you do have generics in 2.0 which are a lot like C++ templates.

Karl

Show quote
"RKT" <ssa***@bellsouth.net> wrote in message
news:AQ0rf.29773$k76.1456@bignews6.bellsouth.net...
> (CSharp, NET2.0)
>
> Is there any way to EITHER:
>
> 1. Programmatically add a server onclick() event hander to the 'HtmlImage'
> HtmlControl control?
>
> OR
>
> 2. Programmatically preempt a 'Image' WebControl from invoking a postback?
>
> I'll spare you the 'why' I need to do this, but (hint) if I could derive a
> base class using a template arg (C++), problem would be solved...
>
>
>
Author
24 Dec 2005 12:37 PM
RKT
Thank you for the pointer back to generics. I had searched for this when I
went to 2.0 and came to the conclusion it wasn't there - yet.

I'll try to craft better search strings this time. Any strong search term
you could add for the benefit of the newsgroup?


Show quote
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:Oz2JloCCGHA.4040@TK2MSFTNGP12.phx.gbl...
> No to both.
>
> You can create a custom server control that inherits from either and
> implements the functionality you want.
>
> Also, you do have generics in 2.0 which are a lot like C++ templates.
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
> http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!
>
>
>
> "RKT" <ssa***@bellsouth.net> wrote in message
> news:AQ0rf.29773$k76.1456@bignews6.bellsouth.net...
> > (CSharp, NET2.0)
> >
> > Is there any way to EITHER:
> >
> > 1. Programmatically add a server onclick() event hander to the
'HtmlImage'
> > HtmlControl control?
> >
> > OR
> >
> > 2. Programmatically preempt a 'Image' WebControl from invoking a
postback?
> >
> > I'll spare you the 'why' I need to do this, but (hint) if I could derive
a
> > base class using a template arg (C++), problem would be solved...
> >
> >
> >
>
>
Author
24 Dec 2005 10:06 PM
Karl Seguin
Not really, doing a basic google search for c# generics (or vb.net generics)
will result in heaps of hits...

Karl

Show quote
"RKT" <ssa***@bellsouth.net> wrote in message
news:8fbrf.17707$kP5.9318@bignews5.bellsouth.net...
> Thank you for the pointer back to generics. I had searched for this when I
> went to 2.0 and came to the conclusion it wasn't there - yet.
>
> I'll try to craft better search strings this time. Any strong search term
> you could add for the benefit of the newsgroup?
>
>
> "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
> wrote in message news:Oz2JloCCGHA.4040@TK2MSFTNGP12.phx.gbl...
>> No to both.
>>
>> You can create a custom server control that inherits from either and
>> implements the functionality you want.
>>
>> Also, you do have generics in 2.0 which are a lot like C++ templates.
>>
>> Karl
>>
>> --
>> MY ASP.Net tutorials
>> http://www.openmymind.net/
>> http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!
>>
>>
>>
>> "RKT" <ssa***@bellsouth.net> wrote in message
>> news:AQ0rf.29773$k76.1456@bignews6.bellsouth.net...
>> > (CSharp, NET2.0)
>> >
>> > Is there any way to EITHER:
>> >
>> > 1. Programmatically add a server onclick() event hander to the
> 'HtmlImage'
>> > HtmlControl control?
>> >
>> > OR
>> >
>> > 2. Programmatically preempt a 'Image' WebControl from invoking a
> postback?
>> >
>> > I'll spare you the 'why' I need to do this, but (hint) if I could
>> > derive
> a
>> > base class using a template arg (C++), problem would be solved...
>> >
>> >
>> >
>>
>>
>
>

AddThis Social Bookmark Button