473,796 Members | 2,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HtmlImage and asp:Image servent onclick event

RKT
(CSharp, NET2.0)

Is there any way to EITHER:

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

OR

2. Programmaticall y 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...

Dec 24 '05 #1
3 5168
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" <ss****@bellsou th.net> wrote in message
news:AQ******** **********@bign ews6.bellsouth. net...
(CSharp, NET2.0)

Is there any way to EITHER:

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

OR

2. Programmaticall y 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...

Dec 24 '05 #2
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?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:Oz******** ******@TK2MSFTN GP12.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" <ss****@bellsou th.net> wrote in message
news:AQ******** **********@bign ews6.bellsouth. net...
(CSharp, NET2.0)

Is there any way to EITHER:

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

OR

2. Programmaticall y 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...


Dec 24 '05 #3
Not really, doing a basic google search for c# generics (or vb.net generics)
will result in heaps of hits...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"RKT" <ss****@bellsou th.net> wrote in message
news:8f******** **********@bign ews5.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:Oz******** ******@TK2MSFTN GP12.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" <ss****@bellsou th.net> wrote in message
news:AQ******** **********@bign ews6.bellsouth. net...
> (CSharp, NET2.0)
>
> Is there any way to EITHER:
>
> 1. Programmaticall y add a server onclick() event hander to the 'HtmlImage' > HtmlControl control?
>
> OR
>
> 2. Programmaticall y 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...
>
>
>



Dec 24 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4412
by: John Scott | last post by:
I am storing an image in an SQL database and have one field as an image datatype. I am also using a webservice to transport data. I want to be able to resize the image and pass back a thumbnail image in a byte of what is in the database. I also want to be able to display this image in an <asp:image></asp:image> control. Is there any way to do this? Most of the examples that I've seen have used
0
2956
by: Daisy | last post by:
Is there any way in an ascx (without resorting to a codebehind file) to have a client-side onload event on an asp:image tag? I've just changed from a normal image, to an asp:image tag, but now it tries to interpret my javascript server-side :-\ <asp:Image runat="server" ImageUrl="a" onload="LoadImage(this);"></asp:Image> :-((
1
4201
by: Chris Fink | last post by:
Hello, Does anyone know of a way to handle broken href image tags either by using the html img tag or the asp:image server control? For example, if my src attribute is broken, I would like to display an alternate image, ie one that blends in with the background instead of the standard eye sore x. I would imagine I could use the <asp:image> server controls events to check the src and then change it if it is broken, i am just not clear...
1
2631
by: xanthviper | last post by:
Hey there, I'm kind of stumped on this and hopefully someone can guide me in the right direction. I have a webform that I am developing in C# using ASP.NET 2.0. On the page_load, I am getting some information from a database query telling me how many images I need to show on the page. Since this count can be
1
2779
by: R.A.M. | last post by:
Hello, Could you help me please with a problem concerning handling at server asp:Images? I have <asp:Image ID="DotNETImage" ImageUrl="Images/DotNET_360x280.jpeg" AlternateText="Microsoft .NET version 2.0" Width="360" Height="280" runat="server" /> which I want to have handled at server when clicked. I thought I can
4
1744
by: R.A.M. | last post by:
Hello, Could anyone help me to handle <asp:Image> click in behind code? I have: <asp:Image ID="DotNETImage" ImageUrl="Images/DotNET_360x280.jpeg" AlternateText="Microsoft .NET version 2.0" Width="360" Height="280" runat="server" /> which I need to handle when clicked. I tried:
4
2833
by: mc | last post by:
Scenario: I have a database of companys, and a directory of images, each image has the name of one of the companys, although not all companys have images. I want a page which displays the details for each of the companys, so far I'm using a repeater with labels for each of the address lines, phone numbers, etc. Problem:
4
4901
by: Deere | last post by:
When I try to take a database field and change it with a function and return it...it will not display the image. The "Imageurl" does not convert to "src=" but stays as ImageUrl. id=Image2 will display ok ..and shows in view source as ....... <img id="gvwExample_ctl07_Image2" src=".\images\toys\1_16\thumb\t_15511.jpg" style="border-width:0px;" />
0
2890
by: Christian Schlemmer | last post by:
hi, in a DetailsView i have a image display. images i want to store in a seperate directory, but it a path is added to Bind update and delete is not working. just Bind makes my DetailsView updateable, but scripts and images would be nice to be seperated.
3
7921
by: Paul Cheetham | last post by:
Hi, I have an application that will display user-defined images in some asp:image controls. (sets the ImageURL, and is always built from the site root) The problem comes when the images specified do not exist, as it displays a red cross and the alternate text. What I would like to do is display a default image instead.
0
9685
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9531
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10018
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
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
3
2928
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.