473,513 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to assign imageurl to image button

64 New Member
Hi,

i had created image button and assigned image url as per the below code

imagebutton1.imageurl = server.mappath("photo")+ "\" + imagefilename
photo -> image folder in my project
imagefilename -> retrieving from database(including extension like .jpg,etc)

and also i had created image button thru html coding as

<img id="imgbtn" runat="server">

and in codebehind page load event

imgbtn.src = server.mappath("photo")+ "\" + imagefilename

but both the codings are working in local system but not in server.

i checked path coding( server.mappath("photo")+ "\" + imagefilename) by assigning to textbox. its working correctly but image is not displayed.

deletion,creation,updation everything is happening but only problem is displaying image.

How can i resolve this problem.
May 12 '07 #1
2 2477
shweta123
692 Recognized Expert Contributor
Hi,

You can try for giving webpath for the ImageUrl
e.g

http://localhost/YourProject/imagefilename


instead of
server.mappath("photo")+ "\" + imagefilename
May 13 '07 #2
gomzi
304 Contributor
Hi,

i had created image button and assigned image url as per the below code

imagebutton1.imageurl = server.mappath("photo")+ "\" + imagefilename
photo -> image folder in my project
imagefilename -> retrieving from database(including extension like .jpg,etc)

and also i had created image button thru html coding as

<img id="imgbtn" runat="server">

and in codebehind page load event

imgbtn.src = server.mappath("photo")+ "\" + imagefilename

but both the codings are working in local system but not in server.

i checked path coding( server.mappath("photo")+ "\" + imagefilename) by assigning to textbox. its working correctly but image is not displayed.

deletion,creation,updation everything is happening but only problem is displaying image.

How can i resolve this problem.
How about trying this out ->
imagebutton1.imageurl = server.mappath("photo/") & imagefilename
May 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
2790
by: Leigh Kendall | last post by:
I can't find any issue in the MS KB, but I'm experiencing the following problem which seems to be specific to IE5, and NOT any other version of IE 5.5+ or NN 6+. Issue: I'm using an asp.net...
3
1608
by: Joe | last post by:
I have a function that changes an image when the user clicks a button (this works fine). There's another button that is used to transfer to another page an pass the selected image as a querystring....
1
9168
by: Nathan Sokalski | last post by:
I am using the ImageUrl property of the Hyperlink control to create a graphical Hyperlink. However, I want to change the size of the image I am using, but the generated HTML places the width/height...
3
10467
by: Thomas Satzinger | last post by:
Hallo., i just encounterd a strange thing which i cannot resolve. I am saving a bitmap created in memory to the asp temp folder (asp.net 2.0) this works fine, and i don´t want to create an...
2
1833
by: Jokerr | last post by:
I have a problem with the Image object and ImageURL. I've looked over some forums however I've gotten nowhere but frustrated fast. I've verified all the data and it's correct. No special...
4
5634
by: AG | last post by:
I have a asp.net 2.0 gridview control with select, edit, delete buttons enabled and set to image button type to display my images. Is there any way to access the selectedimageurl property at run...
3
2233
by: Ganesh | last post by:
Hi There I've assigned the Imageurl on ImageButton in design time like this http://localhost/aspnetsbs_cs/SimpleTest/WebForm4.aspx?image=images/one.jpg&size=100 but when i try from on run...
5
7304
by: OK | last post by:
I am using an image control to display some images within a virtual map (ImagesRoot in IIS) outside of the web root in my vb asp.net application. How should I code the imageurl property to have...
5
6029
by: lianping | last post by:
Hi, I have a problem to assign a value into text box, below will be my script. Before view my script, let me hv quick explain on what is my problem: I would like to assign Java script value...
0
7257
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
7157
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...
0
7535
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...
0
7521
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...
0
4745
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...
0
3232
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...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
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...

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.