473,558 Members | 2,949 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.im ageurl = server.mappath( "photo")+ "\" + imagefilename
photo -> image folder in my project
imagefilename -> retrieving from database(includ ing 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,creati on,updation everything is happening but only problem is displaying image.

How can i resolve this problem.
May 12 '07 #1
2 2482
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.im ageurl = server.mappath( "photo")+ "\" + imagefilename
photo -> image folder in my project
imagefilename -> retrieving from database(includ ing 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,creati on,updation everything is happening but only problem is displaying image.

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

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

Similar topics

9
2793
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 hyperlink control and setting the imageurl property. It seems that when the img tag is rendered in the hyperlink (<a>) tag, the img tag is closed with a />...
3
1611
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. The problem is in the code behind, Image1.ImageUrl always returns the initial image name. Is there a way to get the newly selected one? <script...
1
9196
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 properties in the anchor tag rather than the image tag. Obviously I could write code to generate the anchor/image tags myself, but when a control...
3
10470
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 extra folder in my application, so i don´t need my people giving that folder the asp permissions. Ok, my JPG is in the temp folder.
2
1837
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 characters, just alpha-numeric and an occasional slash(/). I pass the following URL to my image, "charts.aspx?labels=<data>&Data=<data>&title=<data>" ...
4
5635
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 time so I can supply a different image for the selected row? I am assuming that I would do it in the RowDataBound event. Or do I need to use a...
3
2237
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 time, it does not seem to be working someone can advise me please
5
7313
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 this working? Image1.imageurl = ?
5
6044
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 into VB text box, but i fail to do so. I can pass value with using: <form id="form1" runat="server">. however I' not able to do so, as i already use...
0
7629
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...
0
7835
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. ...
0
6183
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...
0
5172
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...
0
3602
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...
0
3578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2045
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
1
1164
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
869
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...

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.