473,721 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What's the server control equivalent of <input type="image"> ?

Hello,

I have a page which I am converting to use themes. The page has an HTML
<input type="image"> element that is used to post to another page. I
would like to replace this with a server control so I can add a skinid.

I tried adding runat="server" and the skinid to the existing control,
but that didn't work. Any other ideas? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 10 '06 #1
17 3206
Use a System.Web.UI.H tmlControls.Htm lImage Control.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Alan Silver" <al*********@no spam.thanx> wrote in message
news:FR******** ******@nospamth ankyou.spam...
Hello,

I have a page which I am converting to use themes. The page has an HTML
<input type="image"> element that is used to post to another page. I would
like to replace this with a server control so I can add a skinid.

I tried adding runat="server" and the skinid to the existing control, but
that didn't work. Any other ideas? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)

Jan 10 '06 #2
>Use a System.Web.UI.H tmlControls.Htm lImage Control.

Isn't that just a plain <img> tag? I want an <input type="image"> tag.
Nothing will happen if you click an HtmlImage control (will it?)

Looking at the SDK, it seems that the following should work...

<input type="image" SkinID="imgBask et" runat="server" />

where the skin file contains...

<asp:ImageButto n skinid="imgBask et" imageurl="image s/basket.gif"
width="119" height="20" runat="server" />

however, that produces the following HTML...

<input name="ctl00$cph MainBody$ctl00$ ctl01" type="image" />

As you can see, no src attribute, and no width or height.

Any ideas? Thanks for the reply.

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 10 '06 #3
I would think...an ImageButton. But I haven't tried it...

Alan Silver wrote:
Hello,

I have a page which I am converting to use themes. The page has an HTML
<input type="image"> element that is used to post to another page. I
would like to replace this with a server control so I can add a skinid.

I tried adding runat="server" and the skinid to the existing control,
but that didn't work. Any other ideas? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)


Jan 10 '06 #4
Hi Alan,

Sorry, yes, the ImageButton is what yuo want, to submit the form. I'm not
sure what is wrong with your use of the "SkinID" attribute. I know that it
is not an HTML attribute, and perhaps ASP.Net checks it. I've never tried to
add a non-standard attribute to an ASP.Net Control. You might try using the
AddAttributes() method of the Control to add it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Alan Silver" <al*********@no spam.thanx> wrote in message
news:qj******** ******@nospamth ankyou.spam...
Use a System.Web.UI.H tmlControls.Htm lImage Control.


Isn't that just a plain <img> tag? I want an <input type="image"> tag.
Nothing will happen if you click an HtmlImage control (will it?)

Looking at the SDK, it seems that the following should work...

<input type="image" SkinID="imgBask et" runat="server" />

where the skin file contains...

<asp:ImageButto n skinid="imgBask et" imageurl="image s/basket.gif"
width="119" height="20" runat="server" />

however, that produces the following HTML...

<input name="ctl00$cph MainBody$ctl00$ ctl01" type="image" />

As you can see, no src attribute, and no width or height.

Any ideas? Thanks for the reply.

--
Alan Silver
(anything added below this line is nothing to do with me)

Jan 10 '06 #5
>Hi Alan,

Sorry, yes, the ImageButton is what yuo want, to submit the form. I'm not
sure what is wrong with your use of the "SkinID" attribute. I know that it
is not an HTML attribute, and perhaps ASP.Net checks it. I've never tried to
add a non-standard attribute to an ASP.Net Control. You might try using the
AddAttributes( ) method of the Control to add it.


According to the SDK, SkinID is an attribute of the HTML control, so
should be used by the framework. That's why I'm confused why it didn't
work.

Any ideas? Thanks

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 11 '06 #6
>I would think...an ImageButton. But I haven't tried it...

I have, and I couldn't get it to work, hence my post ;-)

Thanks anyway
Alan Silver wrote:
Hello,

I have a page which I am converting to use themes. The page has an HTML
<input type="image"> element that is used to post to another page. I
would like to replace this with a server control so I can add a skinid.

I tried adding runat="server" and the skinid to the existing control,
but that didn't work. Any other ideas? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)


--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 11 '06 #7
Hi Alan,

Yes, you're right. I have never used this attribute, so I was unfamiliar
with it. I believe your problem can be solved by assigning an ID attribute
to the Control.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Alan Silver" <al*********@no spam.thanx.inva lid> wrote in message
news:vo******** ******@nospamth ankyou.spam...
Hi Alan,

Sorry, yes, the ImageButton is what yuo want, to submit the form. I'm not
sure what is wrong with your use of the "SkinID" attribute. I know that it
is not an HTML attribute, and perhaps ASP.Net checks it. I've never tried
to
add a non-standard attribute to an ASP.Net Control. You might try using
the
AddAttributes () method of the Control to add it.


According to the SDK, SkinID is an attribute of the HTML control, so
should be used by the framework. That's why I'm confused why it didn't
work.

Any ideas? Thanks

--
Alan Silver
(anything added below this line is nothing to do with me)

Jan 11 '06 #8
>Hi Alan,

Yes, you're right. I have never used this attribute, so I was unfamiliar
with it. I believe your problem can be solved by assigning an ID attribute
to the Control.


Thanks for the reply, however it didn't work ;-)

I changed the server tag to look like...

<input id="inpAddToBas ket" type="image" SkinID="imgBask et"
runat="server" />

and this produced the following HTML...

<input name="ctl00$cph MainBody$ctl00$ inpAddToBasket" type="image"
id="ctl00_cphMa inBody_ctl00_in pAddToBasket" />

As you can see, the src attribute has not been set.

Any other ideas? I'm a bit stuck here as I think I'm doing exactly what
the SDK says you should be able to do, but it isn't working.

Thanks again

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 11 '06 #9
>Hello,

OK, I found the source of my problem...

My skin file contains a definition for an ImageButton, but the control
I'm using *isn't* one of those, it's an <input type="image"> control,
which is an HTML control. ImageButton is a web server control, not an
HTML control.

The problem is that it seems you can't skin HTML controls!! You look in
the SDK, and you see that they have a SkinID property, you look in the
info on skinning and you don't see any disclaimer telling you that you
can't skin an HTML control, but if you try adding the following to your
skin file...

<input type="image" skinid="imgBask et" src="images/basket.gif"
width="119" height="20" runat="server" />

.... you get a parser error "The control type
'System.Web.UI. HtmlControls.Ht mlInputImage' cannot be themed" when you
try and run the page.

So either I'm doing something wrong and there's another way of applying
a skin to an HTML control, or there's a hole in the framework
functionality that is emphasised by an apparently useless property
(SkinID).

I would point out that HTML controls also have an EnableTheming
property, which does imply that they can be skinned, but I can't find
out how to do it.

Anyone any idea about this?

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 11 '06 #10

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

Similar topics

14
13079
by: Gregory | last post by:
Hello, I'm trying to do the above in order to process an image and return the result to an html image control. It fails and my key suspects are either the variable that I'm passing in - ImageName - for processing, or the return data which is done (or not as the case may be) by imagejpeg($img) in the script, after header("Content-type: image/jpeg"). Any insights would be most welcome, especially debugging techniques and a pointer to...
8
3004
by: Eric Bragas | last post by:
What is this? <img src="{$ ImagesDir}/photo.gif"> I KNOW what an HTML image tag looks like. But what do you call that in the file source? Is it like a virtual directory in IIS? It's some type of variable obviously, but can somebody tell me what it's called so I can research how it works? thanks.
5
10456
by: Mikko Rantalainen | last post by:
See example at <URL:http://www.cc.jyu.fi/~mira/moz/formtest.php>. The problem is that the label of submit button is always centered on the button regardsless of 'text-align' property in CSS. Considering that I can style everything else, this must be a bug, right? Any suggestions how to fix the issue with Mozilla 1.4? How about other versions of Mozilla? How about other browsers? (I'm aware that some people think that one should never...
1
3294
by: Mark Sandfox | last post by:
Is there a way to restrict the user to only selecting and sending either a ..gif or .jpg. Everything I have read says this option can not be done by design (security reasons). I find that irronic as this is the reason (security) that I want to restrict their selection. Any help on this one will be greatly appreciated. The page is using ASP.NET.
2
2763
by: Alan Silver | last post by:
Hello, If I have the following HTML... <input type="image" src="fred.gif"> .... is there a way to specify the image in CSS rather than in the HTML? TIA
3
2256
by: =?Utf-8?B?V2lsbA==?= | last post by:
I have an image "button" which causes a postback. I handle the "click" with If Request.Form("btnBU7WD6_Submit.X") 0 Then... this works great. However, when a user double-clicks the image button the Page_Load (postback) is processed twice. This is a problem. Is there any easy way to detect that the image button has been double-cliked
0
8837
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
8728
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
9214
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
8005
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5977
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4751
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2572
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2129
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.