Response.Write to specific page location

M

mcnews

How can I direct Response.Write to output to a specific location on my
page?
TIA,
mcnewsxp
 
E

Evertjan.

mcnews wrote on 21 nov 2006 in microsoft.public.inetserver.asp.general:
How can I direct Response.Write to output to a specific location on my
page?

You cannot.

Response.Write only adds a sting to the rendered html stream,
that is sent to the client browser,
and THEN the browser makes a page of it.

What the broweser does with the html stream is beond ASP's grasp.

I suspect you do not mean just this:

<body>
<%
a = "<div style='position:absolute;top:20px;right:100px;width:200px;'>"
b = "</div>"
Response.Write a & "Hello World" & b
%>
</body>
 
A

Anthony Jones

mcnews said:
How can I direct Response.Write to output to a specific location on my
page?
TIA,
mcnewsxp

You can't. Response.Write outputs the supplied string in to the response
buffer.
 
B

Bob Barrows [MVP]

mcnews said:
is there no way to create a server side label or something then assign
a value to it's text property?

Of course there is. Evertjian showed an example of doing this.
 
M

Mike Brind

mcnews said:
is there no way to create a server side label or something then assign
a value to it's text property?

ASP.NET offers this facility specifically. In classic ASP there is no such
thing as a server-side control. However:

<span id="myLabel">
<% Response.Write "Some Text" %>
</span>

will do it for you. One of the advantages of ASP.NET is that it moves away
from this inline coding model. On the other hand, others find it easier to
see exactly where their output will appear using the classic asp model,
rather than hunting the page for the location of a control.

Whatever floats your boat...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top