Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

i am developed own asp.net project in C#code. in that placed one image control to the purpose of displaying my photo. now i need to replace with my mother photo.
now i am changing in myhome.aspx
ASP.NET
<asp:Image src="Images/myphote.gif" />
//with my photo before changes
------Now i am changing like below-------------
ASP.NET
<asp:Image src="Images/mymotherphoto.gif"/>
now i changes like this after changing like this but not image displayed
and also tried with
ASP.NET
<asp:Image src="~/Image/mymotherphoto.gif"/>

Note: in my project had Images folder.in that I also added my photo also.

please anybody help to me ......


thanks in advance


naresh
Posted
Updated 26-Apr-12 19:58pm
v3
Comments
Sandeep Mewara 27-Apr-12 3:15am    
Was your own photo visible earlier? You just changed the pic name and even though both pics are placed in same folder you dont see the new one?

What it sounds right now is: You were able to see your pic earlier. All you did is changed the pic name and it stopped working. Right?

1 solution

Don't add the image as a resource. I would rather do the following:

Create the image/icon and save it to a file
Choose Project -> Add Existing Item and add the file
Set the Build Action to Embedded Resource

You can then access this resource using
C#
Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceUri)


This way the image is not magically added to the projects resource file and you will only have one copy of the image stored in the assembly's resources.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900