473,385 Members | 1,325 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,385 software developers and data experts.

Specify Image location in Web.Config

Hello Guys,

Just curious over the fact if i can store Image Location in Web.Config and
then how can i extract that location in HTML

<td style="width:1%" align="left" valign="middle">
<img alt="" src="<%# image Location'
%>/Images/lhw_logo_black.jpg" id=headerImage runat=server /></td>
<td style="width: 1%" align="right" valign="middle">

Is it possible to do something like this or not? I am developing in C#2.0 .
I am trying to avoid this in Codebehind.

Thanks

Manny
Feb 22 '08 #1
2 5902
just create a function in you base page like ImagePath(string s) then you can
use it in a binding expression (which will require a bind) or standand.

<img src='<%# ImagePath("myImage.gif")%>' runat="server"/>
<img src='<%= ImagePath("myImage.gif")%>' />

another option is a prerender handler that walks the control collection
(requires each image have a runat=server). and update the src.
-- bruce (sqlwork.com)
"Manny Chohan" wrote:
Hello Guys,

Just curious over the fact if i can store Image Location in Web.Config and
then how can i extract that location in HTML

<td style="width:1%" align="left" valign="middle">
<img alt="" src="<%# image Location'
%>/Images/lhw_logo_black.jpg" id=headerImage runat=server /></td>
<td style="width: 1%" align="right" valign="middle">

Is it possible to do something like this or not? I am developing in C#2.0 .
I am trying to avoid this in Codebehind.

Thanks

Manny
Feb 22 '08 #2
in Page ASPX:
<asp:Image ID="Image1" runat=server ImageUrl = '<%$ appSettings:myImage1
%>' />

in web.config:

<appSettings >
<add key="myImage1" value="~/images/check2.gif"/>
</appSettings>

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: htp://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
"Manny Chohan" wrote:
Hello Guys,

Just curious over the fact if i can store Image Location in Web.Config and
then how can i extract that location in HTML

<td style="width:1%" align="left" valign="middle">
<img alt="" src="<%# image Location'
%>/Images/lhw_logo_black.jpg" id=headerImage runat=server /></td>
<td style="width: 1%" align="right" valign="middle">

Is it possible to do something like this or not? I am developing in C#2.0 .
I am trying to avoid this in Codebehind.

Thanks

Manny
Feb 22 '08 #3

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

Similar topics

1
by: JD | last post by:
I've got a Windows Forms application that I'd like to NOT have an app.config file for. There are, however, a few "utility" assemblies used by the application and I'd like them to be in a...
0
by: Duncan Welch | last post by:
I've got users uploading a file, which I then want resize, make a thumbnail out of, then delete. The image and thumbnail are working fine, but when I try to delete the image, I get an error: "The...
2
by: TaeHo Yoo | last post by:
In my current web.config, I have these lines ----------------------------------------------------------- <authentication mode="Forms"> <forms name="frmAuthentication" loginUrl="login.aspx" />...
11
by: KarimL | last post by:
Thanks for your advices... but i need to get the Image height because i dynamically resize the height of my webcontrol based on the image height. More i just have the url (relative parth) to the...
13
by: Neo Geshel | last post by:
I have examined about 80+ different upload scripts on the 'net, both in VB and C#, and none seem to do what I need them to do. Perhaps someone here can point me somewhere that Google hasn't...
2
by: B.J. Raiford | last post by:
I have a web site that shows the weather for a location and I have a list of weather sites that I regularly used ordered by preference. I had to do this because the location that the client likes...
1
by: Joseph Geretz | last post by:
I need to download a greater than 4 megabyte attachment via WSE / DIME. The only way I know how to configure this is via a .config file. Normally, the ..config file is the same name as the base...
2
by: dgk | last post by:
I have an image in the masterpage which works fine everywhere except the login page. I have the login control on a page (login.aspx naturally) and the user is directed to it via forms...
6
by: Jeff | last post by:
hi asp.net 2.0 I have a image (.jpeg) stored in sql server 2005 and now I want to display it on a webpage. So I created a webpage (Image.aspx) which just writes the buffer data to the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.