Jeffrey McManus

The New Thing

Jeffrey McManus header image 2

Using CSS-P with ASP.NET trace mode

October 3rd, 2003 · 3 Comments · Web/Tech

A few weeks ago I posted this about how ASP.NET doesn’t play nice with XHTML unless you resort to various onerous contortions. I just noticed that ASP.NET trace mode doesn’t like absolute positioning in CSS-P, either.

When I saw this I thought I was screwed, but then I realized that surely the geniuses who thought up ASP.NET trace mode had the presence of mind to wrap the trace output in a DIV tag so you could position it anywhere on the page with CSS-P. And, in fact, they did. (The ID of the DIV is __asptrace — that’s a pair of leading underscores if you’re scoring at home.)

So that means if you’re using CSS-P with an ASP.NET page in trace mode, you can make the trace output appear anywhere on the page you want, yippee! I put my trace output over on the right side of my page design.

Related posts:

  1. Revisiting Role-Playing

Tags:

3 Comments so far ↓

  • PhoneTech

    How exactly did you do this? I have defined the __asptrace to a location, but it seems that it still renders it as a background.

    Current score: 0
  • Daren Dahl

    This appears to only work in Mozilla. IE doesn’t apply the style. I believe IE is having trouble with the underscores. I haven’t found a way to make this work in IE outside of clumsy javascript.

    Current score: 0
  • MIke Malburg

    I wasn’t able to get this working in IE with CSS, but you could write this into your javascript onload function for that page:

    __asptrace.style.position = “absolute”;
    __asptrace.style.top = “500px”;
    __asptrace.style.left = “0px”;

    Change the top and left to wherever you want to absolutely position that div on the page. Not real fancy, but it works in IE6.

    Current score: 0

Leave a Comment