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

Web User Controls: A GIF in resx

I have made an user control for a header for all web pages.

Now I want to add an image in the header.

What is the best way of embedding a GIF in the usercontrol?

I donot want to distribute the image separately from the usercontrol.

Put the gif in the resourcefile?
Other options?

/k
Nov 19 '05 #1
4 1562
kurt sune wrote:
I have made an user control for a header for all web pages.

Now I want to add an image in the header.

What is the best way of embedding a GIF in the usercontrol?

I donot want to distribute the image separately from the usercontrol.

Put the gif in the resourcefile?
Other options?

/k


You can't just embed an image in the html-stream, images are always
requested by the server in a separate request.
The html-source just contains an <img> tag with a "src" attribute
pointing somewhere. The browser reacts to this by sending a separate
request for the url in that src attribute.

So if you don't want to have a separate file, you will have to provide some
other means to get at that image. This usually means that you need
a separate aspx or an http-handler (or in general: some url that will
provide that image -- which can then come from some other place on the
filesystem, a database or a resource file).

Hans Kesting
Nov 19 '05 #2
Do you think it would be feasible to store a GIF in a resource file in a web
custom control and in the render method stream out a string like this
"<DIV id="header2" style="Z-INDEX: 103" ms_positioning="GridLayout"><IMG
style="Z-INDEX: 101" src="Logo.gif"></DIV>

and replace the file name with a bitstream?

/k

You can't just embed an image in the html-stream, images are always
requested by the server in a separate request.
The html-source just contains an <img> tag with a "src" attribute
pointing somewhere. The browser reacts to this by sending a separate
request for the url in that src attribute.

So if you don't want to have a separate file, you will have to provide some other means to get at that image. This usually means that you need
a separate aspx or an http-handler (or in general: some url that will
provide that image -- which can then come from some other place on the
filesystem, a database or a resource file).

Hans Kesting

Nov 19 '05 #3
kurt sune wrote:
Do you think it would be feasible to store a GIF in a resource file
in a web custom control and in the render method stream out a string
like this "<DIV id="header2" style="Z-INDEX: 103"
ms_positioning="GridLayout"><IMG style="Z-INDEX: 101"
src="Logo.gif"></DIV>

and replace the file name with a bitstream?

/k


No, you can *not* replace that url with a bitstream. The html source-code
and the image data are two separate responses to two separate requests
of the browser.

You can't just embed an image in the html-stream, images are always
requested by the server in a separate request.
The html-source just contains an <img> tag with a "src" attribute
pointing somewhere. The browser reacts to this by sending a separate
request for the url in that src attribute.

So if you don't want to have a separate file, you will have to
provide some other means to get at that image. This usually means
that you need
a separate aspx or an http-handler (or in general: some url that will
provide that image -- which can then come from some other place on
the filesystem, a database or a resource file).

Hans Kesting

Nov 19 '05 #4
I need more Information !

Sure, you can put it into a directory and that's it!
Or into a resource file!

But it's also possible to save it as BLOB into a database - you should do
this when there's a possibility to change the bitmap from the ASPX.
Nov 19 '05 #5

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

Similar topics

0
by: Patrick Corkum | last post by:
Hello, I am having a really annoying problem. I have a base form, say FormA, and this form has some buttons on it with images (which are stored in the resx file). I then have FormB, which...
1
by: Gabriel Lozano-Morán | last post by:
First of all sorry for the cross-posting but I am not sure wether this belongs under internationalization or just general. Environment: Visual Studio .NET 2003 Problem: Newly added and...
2
by: qh0st | last post by:
Hi all. I have an windows form application that will have multiple language ..resx files per form. Is there anyway I can bundle these .resx files into ONE .dll per form? If not, do you have any...
1
by: Daves | last post by:
emm thought (under 2.0) I could use "App_GlobalResources" for keeping all user controls (accessed from all pages)... this throws an error... was there some other directory specially thought for...
0
by: Grzesiek | last post by:
Hi! I'm trying to build IE Web Controls with VS .NET. When I've done it using build.bat, everything was fine. But now I want to add some features to BasicChildNode class, so I've created solution...
5
by: Paul Fredlein | last post by:
Hi, I have a user control in one project that I would like to use in another. I've tried; 'copy' but can't 'paste'; 'save as .vb' but then when I open it in the other project the code's there...
0
by: prabhupr | last post by:
Hi Folks I'm currently working on a Localization+Globalization project; for this project, we need to generate ".Resx" files and we use "US English" Resx file as the base version, to compare the...
0
by: mschep | last post by:
Hi, I built an assembly with a set of user controls. This can be done with the Visual Studio 2005 Deployment Project: building and merging for example all your aspx and ascx in one dll (lets...
0
by: greatbrendi | last post by:
Hi, I have an annoying problem, that I cannot defeat by myself... I positioned 2 inherited controls on a user control. It worked well. but at some point I started to get the warning...
0
by: Ryan Liu | last post by:
Hi, I have this inconsistent problem for days and really get me exhausted. I have a user control with a datagrid, a small toolbar, a label and a text box on it. Toolbar has buttons to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
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
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...
0
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.