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

Watermark in background for Debug build

I was wondering what the best way to acheive the following would be:

What I would like is for the background of every page in my ASP.NET web
project to contain a soft red GIF containing the word "TEST" when the
version being viewed has been compiled using the DEBUG build. Once we build
a release version and place that into production, we obviously want that
"watermark" to disappear.

Now, I suppose I could create two cascading style sheets, one containing a
body - background entry for test, the other without it for production. Is
this the best method, or is there another way?

- Dave
Nov 18 '05 #1
1 1480
If you haven't done so already, you could create a base class for the pages
in your project and in one of the page events (probably PreRender) you could
dynamically add a control using a directive

[C#]
#if DEBUG
Page.Controls.Add(new LiteralControl("<img src=\"test.gif\" />"));
#endif

[VB.NET]
#If DEBUG Then
Page.Controls.Add(new LiteralControl("<img src=""test.gif"" />"))
#End If

If there is a specific place you wish to place the image you could use the
AddAt method of the ControlCollection.

(I may be a little off on the syntax for VB.NET since I have only been using
C#)

"David Slinn" <ds****@accesscomm.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I was wondering what the best way to acheive the following would be:

What I would like is for the background of every page in my ASP.NET web
project to contain a soft red GIF containing the word "TEST" when the
version being viewed has been compiled using the DEBUG build. Once we build a release version and place that into production, we obviously want that
"watermark" to disappear.

Now, I suppose I could create two cascading style sheets, one containing a
body - background entry for test, the other without it for production. Is
this the best method, or is there another way?

- Dave

Nov 18 '05 #2

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

Similar topics

0
by: Thomas | last post by:
I've searched google for this topic and found a few examples, but I need an example of how to create a semi-transparent, non-intrusive watermark for images using PIL, something that takes into...
0
by: Keith Davies | last post by:
Hi All, a friend wants to create a PDF (using XSL-FO) that contains a watermark that covers the entire page. <fo:block background-image='...'> surrounding the content of the flow almost...
1
by: David Slinn | last post by:
I was wondering what the best way to acheive the following would be: What I would like is for the background of every page in my ASP.NET web project to contain a soft red GIF containing the word...
1
by: Cindy H | last post by:
Hi I'm would like to use a watermark for a background on my web pages. I used the style builder in Visual Studio.Net to add this as a background. It inserted the code in the <body> The problem...
9
by: Chuck Anderson | last post by:
Is it possible to overlay a transparent watermark on an image - dynamically? I'd like the result to look like this example: <http://www.cycletourist.com/temp/photo.php> That is a bit of...
0
by: =?Utf-8?B?S2Vycnk=?= | last post by:
Hi all -- I am a long-time C programmer and "medium-time" C++ programmer, but am brand new to C#. I am creating a simple app using C# and I need help. The app will display a "watermark" on...
2
by: troberts | last post by:
Hi What I'm trying to achieve is a watermark on a search box (text input). I've got it working fine (it displays an image, onfocus it shows no image) but when the user writes something then clicks...
1
by: rfr | last post by:
Apparently the Transitional Doctype kills this script because the script does not make proper use of units like "px". It works well without a doctype statement. But once someone adds a...
4
karthickkuchanur
by: karthickkuchanur | last post by:
I am using JasperReports 2.0.5. I am trying to use the background tag to generate a watermark image for my reports. JRXML source is below and also attached.The problem is that I do not get HTML...
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:
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
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?
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...
0
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,...
0
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,...
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...

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.