473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ImageButton and download file

I want to put a image button on the page where if user clicks should
download a zip file for the user

I could do it following way but I want to put asp.net button.

<a href="Myzip.zip"><img src="images/download_trial_btn.gif"/></a>
Jun 27 '08 #1
3 3916
Hi

Hi whats wrong with your current code? it works and work okay...

well

here is a code example... for you,,,,

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/
cet_normal.png" onclientclick="yahoo(); return false;" />
<script language="javascript" type="text/javascript">
function yahoo()
{
window.location = "http://localhost:5504/
icons_for_entity.zip";
return false;
}
</script>

Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
Jun 27 '08 #2
Hello adnan
I could do it following way but I want to put asp.net button.
Why?
<a href="Myzip.zip"><img src="images/download_trial_btn.gif"/></a>
Use a HyperLink Control and thus .ImageUrl Property.

At this issue, a ImageButton is not needed - its the wrong control instead.

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Jun 27 '08 #3
In the image button's server side click event you could put code like this:

Response.Redirect("Myzip.zip")

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
http://iPhonePlaza.net
<ad**********@motiont.comwrote in message
news:64**********************************@j22g2000 hsf.googlegroups.com...
>I want to put a image button on the page where if user clicks should
download a zip file for the user

I could do it following way but I want to put asp.net button.

<a href="Myzip.zip"><img src="images/download_trial_btn.gif"/></a>
Jun 27 '08 #4

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

Similar topics

2
by: Chuck Hartman | last post by:
I've been trying to add an ImageButton object to a Calendar table cell, but so far I am unable to handle the Command event from that button in my form's code behind. Below is an example of what I...
1
by: Henke | last post by:
Hello, I have one ImageButton controls which I initialize in Page_Load and declare on class level. ImageButton save = new ImageButton(); save.ImageUrl = "save.gif" save.Click += new...
2
by: Darren Clark | last post by:
I have an image button on a page <asp:ImageButton Runat=server ID="btSimpleSearch" onMouseOut="this.src = 'images/button_search_n.gif'" onMouseOver="this.src = 'images/button_search_r.gif'"...
6
by: ruca | last post by:
Hi gurus, I have a imagebutton in my WebForm, and I want that when I click (mouse down) on her the imagebutton change image and when I "unclick" (mouse up) change to the original image. Basically...
3
by: Benjamin Gavin | last post by:
Hi all, I recently stumbled upon a bug in the ASP.NET framework handling of ImageButton based postbacks. The issues derives from the fact that IE and Mozilla handle the case of a missing image...
3
by: tshad | last post by:
I was trying to change my asp:button to asp:ImageButton, but got a message saying that ImageButton does not have an onClick function. How do I get the ImageButton call a function? Thanks, ...
5
by: Arthur Hsu | last post by:
Hello, I have an ImageButton that refers to an external image. How can I keep that image's aspect ratio when I set the ImageButton's size to 120x120? TIA, Arthur
2
by: CJ Oakwood | last post by:
Morning - I am hoping somebody from this group can help me out here... I have been trying to add an array of ImageButtons to my WebForm however I keep getting an exception that I can't seem to...
1
by: Shapper | last post by:
Hello, I have 2 Asp:ImageButton in my .aspx file and I have the function "Run" in m .aspx.vb file. I need to run this function when one of the ImageButtons is pressed but I need to know which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...

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.