Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Watermark in background for Debug build

Reply
Thread Tools

Watermark in background for Debug build

 
 
David Slinn
Guest
Posts: n/a
 
      06-27-2004
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


 
Reply With Quote
 
 
 
 
EijiTek
Guest
Posts: n/a
 
      06-27-2004
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" <(E-Mail Removed)> wrote in message
news:%236yh0l$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Background (watermark) image for master page Zilla ASP .Net 4 07-16-2010 12:07 PM
SWsoft Acronis Disk Director Suite 9.0 Build 508, Acronis OS Selector 8.0 Build 917, Acronis Partition Expert 2003 Build 292, Acronis Power Utilities 2004 Build 502, F-SECURE.ANTI vIRUS.PROXY v1.10.17.WINALL, F-SECURE.ANTI vIRUS v5.50.10260 for CITRI vvcd Computer Support 0 09-25-2004 01:38 AM
Adding a Watermark to an Image m3ckon ASP .Net 1 08-05-2004 01:06 PM
Background image, fixed and resizeable, watermark. HELP. surjit Java 1 02-19-2004 08:32 PM
Watermark or Background Image Terry Murray HTML 1 09-17-2003 03:44 PM



Advertisments