473,657 Members | 2,358 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5913
just create a function in you base page like ImagePath(strin g s) then you can
use it in a binding expression (which will require a bind) or standand.

<img src='<%# ImagePath("myIm age.gif")%>' runat="server"/>
<img src='<%= ImagePath("myIm age.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:myI mage1
%>' />

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
2740
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 subdirectory of the main app directory: c:\mainapp c:\mainapp\libraries I'm wondering if I can programmatically specify the "libraries" directory as a location to probe for assemblies at runtime. I don't see anywhere that the
0
1647
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 process cannot access the file "c:\inetpub\wwwroot\pictures\1\21_orig.jpg" because it is being used by another process. " I'm using the Image.Dispose() method before trying to delete it; how do I free up this image? Thanks in advance,
2
5081
by: TaeHo Yoo | last post by:
In my current web.config, I have these lines ----------------------------------------------------------- <authentication mode="Forms"> <forms name="frmAuthentication" loginUrl="login.aspx" /> </authentication> ----------------------------------------------------------- How do I need to modify it, so that contactUS.aspx should be accessed without logining in. Thanks a lot in advance,
11
2017
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 the image but in design time mode all variables concerning Server or Context ar not set ! ...so I can't use MapPath function to obtain the physical parth of the picture ... So my second question is how to retrieve the physical root path of the...
13
2345
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 reached yet (I have gone all the way to page 50 on Google's results!!). Here are my requirements: • I have a DataGrid. Everything will be done from here. Everything. No exceptions. Everything will also be done in VB, without any code-behind to...
2
1191
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 most goes down all of the time and I get crap for it not working correctly. So basically I want to try a list of images and display the first one that appears, the code I have below works be it is way to slow because it waits for a network...
1
2565
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 application. I built a .NET driver program to test this, NetBrokerDriver and provided a NetBrokerDriver.exe.config file which specifies the following: <messaging> <maxRequestLength>-1</maxRequestLength> </messaging>
2
3010
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 authentication. On that page, the image in the masterpage is replaced by the default square. Anyone know what's up with this?
6
2184
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 Response object. On Default.aspx I use this Image.aspx for displaying the image, but no image
0
8411
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8613
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7351
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5638
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.