Response.Write() to a <DIV> tag

joe_pool_is

Contributor
Joined
Jan 18, 2004
Messages
507
Location
Longview, TX [USA]
Is there a way to get my ASP responses to output to a <div> tag?

In my code, if there is an error or if I just want to view the data, I simply write to the screen with Response.Write(data).

The trouble is, this looks tacky! Expecially if your customer happens to see it before you have cleaned it up.

I'd like to have the response write to a <div> tag, instead. Then, the <div> tag can be visible only while I am debugging.

Also, if I ever have to do work on the code later, make the <div> tag visible again, and off I go!
 
What about using this for your div on the load event:

Visual Basic:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        divTest.Visible = HttpContext.Current.IsDebuggingEnabled
End Sub
 
Hi Davearia,

Actually, I'm not even worried about determining whether or not I am in debug mode. I can just set the <div> tag to size zero or position it off screen.

I want to know how to tell a <%=Response.Write(value)%> to be directed to a <div> tag.

I may have found a way, though. Right now I have an Asp Lable in my <div> tag, and all errors are appended to that label.

I just didn't think of that route before.
 
Back
Top