Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!

Posted

What about using this for your div on the load event:

 

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

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...