change button's background?

H

haiwen

Hello, everyone:

could anyone tell me if it is possible to change
background of the browser button in <input type="file">
with an image.

I do appreciate your help,

best wishes,

haiwen
 
H

haiwen

Hi,

the problem is if I use <input type = "file"
style="BACKGROUND-IMAGE: url(./images/browser.jpg)">

the image will display as the background of the text box,
but what I want is as the background of the browser button.

could you show me how to set up the image for the browser
button.

I do appreciate your help,

haiwen
 
K

Knute Hestness

Why don't you use the asp:imagebutton? :
<asp:imagebutton id="reviewButton" runat="server"
imageurl="images/review.gif"></asp:imagebutton>

~ Knute
 
H

haiwen

Hello,

could you show me how to use imagebutton to allow client
upload file?

I want to upload file from the client to server, I have to
use <input type="file" .. to do it, this html control
includes a textbox and a browser button, it seems there is
no way to change the button's apperance, because even I
use style="..." and it just affect the textbox's apperance.

Could anyone help me?

thanks a lot,

haiwen
 
Y

Yan-Hong Huang[MSFT]

Hello Haiwen,

Please refer to code sample at http://www.codeproject.com/aspnet/upsanddowns.asp.

I think you could change the button to ImageButton easily.

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "haiwen" <[email protected]>
!Sender: "haiwen" <[email protected]>
!References: <[email protected]> <[email protected]>
<[email protected]> <[email protected]>
!Subject: there's no way to change the apperance of file's control button???
!Date: Thu, 31 Jul 2003 08:04:35 -0700
!Lines: 72
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcNXdQ4SnzcYoPcwQvCmRVKvy11U0A==
!Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.webcontrols:13568
!NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
!
!Hello,
!
!could you show me how to use imagebutton to allow client
!upload file?
!
!I want to upload file from the client to server, I have to
!use <input type="file" .. to do it, this html control
!includes a textbox and a browser button, it seems there is
!no way to change the button's apperance, because even I
!use style="..." and it just affect the textbox's apperance.
!
!Could anyone help me?
!
!thanks a lot,
!
!haiwen
!
!
!
!
!>-----Original Message-----
!>Why don't you use the asp:imagebutton? :
!><asp:imagebutton id="reviewButton" runat="server"
!>imageurl="images/review.gif"></asp:imagebutton>
!>
!>~ Knute
!>>-----Original Message-----
!>>Hi,
!>>
!>>the problem is if I use <input type = "file"
!>>style="BACKGROUND-IMAGE: url(./images/browser.jpg)">
!>>
!>>the image will display as the background of the text
!>box,
!>>but what I want is as the background of the browser
!>button.
!>>
!>>could you show me how to set up the image for the
!>browser
!>>button.
!>>
!>>I do appreciate your help,
!>>
!>>haiwen
!>>
!>>>-----Original Message-----
!>>>yes use a style <input type = "file" style=...
!>>>!>>>> Hello, everyone:
!>>>>
!>>>> could anyone tell me if it is possible to change
!>>>> background of the browser button in <input
!>type="file">
!>>>> with an image.
!>>>>
!>>>> I do appreciate your help,
!>>>>
!>>>> best wishes,
!>>>>
!>>>> haiwen
!>>>>
!>>>>
!>>>>
!>>>
!>>>
!>>>.
!>>>
!>>.
!>>
!>.
!>
!
 
H

haiwen

hello, yanhong:

the input type="file" html control generates the browse
button automatically, it's no easy to modify its
appearance since the article has nothing with my question.

thanks a lot,

haiwen
 
Y

Yan-Hong Huang[MSFT]

Hello Haiwen,

I am glad to work with you again. :)

I performed research on it. Now you want to change the image for the button that is created by an input tag of type 'file'. That
input tag is HTML only (there's no web control for it). Also, it generates two screen elements, a text box and a button.

Using the tag's style property, I was able to assign an image to the background. However, that turned out to be the
background for the text box rather than the button. I don't think there is any way to do this except by not using a 'file' input tag.
Perhaps an ActiveX control - though that would mean you would have to write code to stream the data to the server. One
other thing that you might try is to write a HTML client for a web service. The client-side script would have to stream the data
to the web service. In either of these methods, the end users would have to have their security settings set to allow this web
page permission to access the hard drive.

Hope it helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "haiwen" <haiwen@itctrng>
!Sender: "haiwen" <haiwen@itctrng>
!References: <[email protected]> <[email protected]>
<[email protected]> <[email protected]> <00ef01c35775
[email protected]> <[email protected]>
!Subject: it is not easy?
!Date: Mon, 4 Aug 2003 08:46:13 -0700
!Lines: 136
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcNan4h9j7QwikVeT+aoS/VBrD0BBg==
!Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.webcontrols:13648
!NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
!
!hello, yanhong:
!
!the input type="file" html control generates the browse
!button automatically, it's no easy to modify its
!appearance since the article has nothing with my question.
!
!thanks a lot,
!
!haiwen
!>-----Original Message-----
!>Hello Haiwen,
!>
!>Please refer to code sample at
!http://www.codeproject.com/aspnet/upsanddowns.asp.
!>
!>I think you could change the button to ImageButton easily.
!>
!>Hope that helps.
!>
!>Best regards,
!>Yanhong Huang
!>Microsoft Online Partner Support
!>
!>Get Secure! - www.microsoft.com/security
!>This posting is provided "AS IS" with no warranties, and
!confers no rights.
!>
!>--------------------
!>!Content-Class: urn:content-classes:message
!>!From: "haiwen" <[email protected]>
!>!Sender: "haiwen" <[email protected]>
!>!References: <[email protected]>
!<[email protected]>
!><[email protected]> <007301c356c5
[email protected]>
!>!Subject: there's no way to change the apperance of
!file's control button???
!>!Date: Thu, 31 Jul 2003 08:04:35 -0700
!>!Lines: 72
!>!Message-ID: <[email protected]>
!>!MIME-Version: 1.0
!>!Content-Type: text/plain;
!>! charset="iso-8859-1"
!>!Content-Transfer-Encoding: 7bit
!>!X-Newsreader: Microsoft CDO for Windows 2000
!>!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!>!Thread-Index: AcNXdQ4SnzcYoPcwQvCmRVKvy11U0A==
!>!Newsgroups:
!microsoft.public.dotnet.framework.aspnet.webcontrols
!>!Path: cpmsftngxa06.phx.gbl
!>!Xref: cpmsftngxa06.phx.gbl
!microsoft.public.dotnet.framework.aspnet.webcontrols:13568
!>!NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
!>!X-Tomcat-NG:
!microsoft.public.dotnet.framework.aspnet.webcontrols
!>!
!>!Hello,
!>!
!>!could you show me how to use imagebutton to allow client
!>!upload file?
!>!
!>!I want to upload file from the client to server, I have
!to
!>!use <input type="file" .. to do it, this html control
!>!includes a textbox and a browser button, it seems there
!is
!>!no way to change the button's apperance, because even I
!>!use style="..." and it just affect the textbox's
!apperance.
!>!
!>!Could anyone help me?
!>!
!>!thanks a lot,
!>!
!>!haiwen
!>!
!>!
!>!
!>!
!>!>-----Original Message-----
!>!>Why don't you use the asp:imagebutton? :
!>!><asp:imagebutton id="reviewButton" runat="server"
!>!>imageurl="images/review.gif"></asp:imagebutton>
!>!>
!>!>~ Knute
!>!>>-----Original Message-----
!>!>>Hi,
!>!>>
!>!>>the problem is if I use <input type = "file"
!>!>>style="BACKGROUND-IMAGE: url(./images/browser.jpg)">
!>!>>
!>!>>the image will display as the background of the text
!>!>box,
!>!>>but what I want is as the background of the browser
!>!>button.
!>!>>
!>!>>could you show me how to set up the image for the
!>!>browser
!>!>>button.
!>!>>
!>!>>I do appreciate your help,
!>!>>
!>!>>haiwen
!>!>>
!>!>>>-----Original Message-----
!>!>>>yes use a style <input type = "file" style=...
!>!>>>!>!>>>> Hello, everyone:
!>!>>>>
!>!>>>> could anyone tell me if it is possible to change
!>!>>>> background of the browser button in <input
!>!>type="file">
!>!>>>> with an image.
!>!>>>>
!>!>>>> I do appreciate your help,
!>!>>>>
!>!>>>> best wishes,
!>!>>>>
!>!>>>> haiwen
!>!>>>>
!>!>>>>
!>!>>>>
!>!>>>
!>!>>>
!>!>>>.
!>!>>>
!>!>>.
!>!>>
!>!>.
!>!>
!>!
!>
!>
!>.
!>
!
 
H

haiwen

hello, Yanhong:

I will try the methods that you suggest.
Thanks for your help all the time.

Best wishes,

haiwen
-----Original Message-----
Hello Haiwen,

I am glad to work with you again. :)

I performed research on it. Now you want to change the
image for the button that is created by an input tag of
type 'file'. That
input tag is HTML only (there's no web control for it).
Also, it generates two screen elements, a text box and a
button.
Using the tag's style property, I was able to assign an
image to the background. However, that turned out to be
the
background for the text box rather than the button. I
don't think there is any way to do this except by not
using a 'file' input tag.
Perhaps an ActiveX control - though that would mean you
would have to write code to stream the data to the server.
One
other thing that you might try is to write a HTML client
for a web service. The client-side script would have to
stream the data
to the web service. In either of these methods, the end
users would have to have their security settings set to
allow this web
page permission to access the hard drive.

Hope it helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "haiwen" <haiwen@itctrng>
!Sender: "haiwen" <haiwen@itctrng>
!References: <[email protected]>
[email protected]> <00ef01c35775
 
Y

Yan-Hong Huang[MSFT]

Hello Haiwen,

You are welcome. :)

Thanks very much for participating the community.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "haiwen" <[email protected]>
!Sender: "haiwen" <[email protected]>
!References: <[email protected]> <[email protected]>
<[email protected]> <[email protected]> <00ef01c35775
[email protected]> <[email protected]> <085401c35a9f$887dedc0
[email protected]> <[email protected]>
!Subject: thanks a lot
!Date: Wed, 6 Aug 2003 10:09:35 -0700
!Lines: 227
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcNcPYMjqaj+SukfRJ2hS0HRNN67UQ==
!Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.webcontrols:13724
!NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
!
!hello, Yanhong:
!
!I will try the methods that you suggest.
!Thanks for your help all the time.
!
!Best wishes,
!
!haiwen
!>-----Original Message-----
!>Hello Haiwen,
!>
!>I am glad to work with you again. :)
!>
!>I performed research on it. Now you want to change the
!image for the button that is created by an input tag of
!type 'file'. That
!>input tag is HTML only (there's no web control for it).
!Also, it generates two screen elements, a text box and a
!button.
!>
!>Using the tag's style property, I was able to assign an
!image to the background. However, that turned out to be
!the
!>background for the text box rather than the button. I
!don't think there is any way to do this except by not
!using a 'file' input tag.
!>Perhaps an ActiveX control - though that would mean you
!would have to write code to stream the data to the server.
!One
!>other thing that you might try is to write a HTML client
!for a web service. The client-side script would have to
!stream the data
!>to the web service. In either of these methods, the end
!users would have to have their security settings set to
!allow this web
!>page permission to access the hard drive.
!>
!>Hope it helps.
!>
!>Best regards,
!>Yanhong Huang
!>Microsoft Online Partner Support
!>
!>Get Secure! - www.microsoft.com/security
!>This posting is provided "AS IS" with no warranties, and
!confers no rights.
!>
!>--------------------
!>!Content-Class: urn:content-classes:message
!>!From: "haiwen" <haiwen@itctrng>
!>!Sender: "haiwen" <haiwen@itctrng>
!>!References: <[email protected]>
!<[email protected]>
!><[email protected]> <007301c356c5
[email protected]> <00ef01c35775
!>[email protected]>
!<[email protected]>
!>!Subject: it is not easy?
!>!Date: Mon, 4 Aug 2003 08:46:13 -0700
!>!Lines: 136
!>!Message-ID: <[email protected]>
!>!MIME-Version: 1.0
!>!Content-Type: text/plain;
!>! charset="iso-8859-1"
!>!Content-Transfer-Encoding: 7bit
!>!X-Newsreader: Microsoft CDO for Windows 2000
!>!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!>!Thread-Index: AcNan4h9j7QwikVeT+aoS/VBrD0BBg==
!>!Newsgroups:
!microsoft.public.dotnet.framework.aspnet.webcontrols
!>!Path: cpmsftngxa06.phx.gbl
!>!Xref: cpmsftngxa06.phx.gbl
!microsoft.public.dotnet.framework.aspnet.webcontrols:13648
!>!NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
!>!X-Tomcat-NG:
!microsoft.public.dotnet.framework.aspnet.webcontrols
!>!
!>!hello, yanhong:
!>!
!>!the input type="file" html control generates the browse
!>!button automatically, it's no easy to modify its
!>!appearance since the article has nothing with my
!question.
!>!
!>!thanks a lot,
!>!
!>!haiwen
!>!>-----Original Message-----
!>!>Hello Haiwen,
!>!>
!>!>Please refer to code sample at
!>!http://www.codeproject.com/aspnet/upsanddowns.asp.
!>!>
!>!>I think you could change the button to ImageButton
!easily.
!>!>
!>!>Hope that helps.
!>!>
!>!>Best regards,
!>!>Yanhong Huang
!>!>Microsoft Online Partner Support
!>!>
!>!>Get Secure! - www.microsoft.com/security
!>!>This posting is provided "AS IS" with no warranties,
!and
!>!confers no rights.
!>!>
!>!>--------------------
!>!>!Content-Class: urn:content-classes:message
!>!>!From: "haiwen" <[email protected]>
!>!>!Sender: "haiwen" <[email protected]>
!>!>!References: <[email protected]>
!>!<[email protected]>
!>!><[email protected]> <007301c356c5
!>[email protected]>
!>!>!Subject: there's no way to change the apperance of
!>!file's control button???
!>!>!Date: Thu, 31 Jul 2003 08:04:35 -0700
!>!>!Lines: 72
!>!>!Message-ID: <[email protected]>
!>!>!MIME-Version: 1.0
!>!>!Content-Type: text/plain;
!>!>! charset="iso-8859-1"
!>!>!Content-Transfer-Encoding: 7bit
!>!>!X-Newsreader: Microsoft CDO for Windows 2000
!>!>!X-MimeOLE: Produced By Microsoft MimeOLE
!V5.50.4910.0300
!>!>!Thread-Index: AcNXdQ4SnzcYoPcwQvCmRVKvy11U0A==
!>!>!Newsgroups:
!>!microsoft.public.dotnet.framework.aspnet.webcontrols
!>!>!Path: cpmsftngxa06.phx.gbl
!>!>!Xref: cpmsftngxa06.phx.gbl
!>!
!microsoft.public.dotnet.framework.aspnet.webcontrols:13568
!>!>!NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
!>!>!X-Tomcat-NG:
!>!microsoft.public.dotnet.framework.aspnet.webcontrols
!>!>!
!>!>!Hello,
!>!>!
!>!>!could you show me how to use imagebutton to allow
!client
!>!>!upload file?
!>!>!
!>!>!I want to upload file from the client to server, I
!have
!>!to
!>!>!use <input type="file" .. to do it, this html control
!>!>!includes a textbox and a browser button, it seems
!there
!>!is
!>!>!no way to change the button's apperance, because even
!I
!>!>!use style="..." and it just affect the textbox's
!>!apperance.
!>!>!
!>!>!Could anyone help me?
!>!>!
!>!>!thanks a lot,
!>!>!
!>!>!haiwen
!>!>!
!>!>!
!>!>!
!>!>!
!>!>!>-----Original Message-----
!>!>!>Why don't you use the asp:imagebutton? :
!>!>!><asp:imagebutton id="reviewButton" runat="server"
!>!>!>imageurl="images/review.gif"></asp:imagebutton>
!>!>!>
!>!>!>~ Knute
!>!>!>>-----Original Message-----
!>!>!>>Hi,
!>!>!>>
!>!>!>>the problem is if I use <input type = "file"
!>!>!>>style="BACKGROUND-IMAGE: url(./images/browser.jpg)">
!>!>!>>
!>!>!>>the image will display as the background of the text
!>!>!>box,
!>!>!>>but what I want is as the background of the browser
!>!>!>button.
!>!>!>>
!>!>!>>could you show me how to set up the image for the
!>!>!>browser
!>!>!>>button.
!>!>!>>
!>!>!>>I do appreciate your help,
!>!>!>>
!>!>!>>haiwen
!>!>!>>
!>!>!>>>-----Original Message-----
!>!>!>>>yes use a style <input type = "file" style=...
!>!>!>>>!>!>!>>>> Hello, everyone:
!>!>!>>>>
!>!>!>>>> could anyone tell me if it is possible to change
!>!>!>>>> background of the browser button in <input
!>!>!>type="file">
!>!>!>>>> with an image.
!>!>!>>>>
!>!>!>>>> I do appreciate your help,
!>!>!>>>>
!>!>!>>>> best wishes,
!>!>!>>>>
!>!>!>>>> haiwen
!>!>!>>>>
!>!>!>>>>
!>!>!>>>>
!>!>!>>>
!>!>!>>>
!>!>!>>>.
!>!>!>>>
!>!>!>>.
!>!>!>>
!>!>!>.
!>!>!>
!>!>!
!>!>
!>!>
!>!>.
!>!>
!>!
!>
!>
!>.
!>
!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top