473,326 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Response.write position

Gav
Hi all,

I have created a user control and I am using Response.Write in the control
to 'write' exactly what I want although it always goes to the top of the
page (above <HTML><HEAD> etc). Can I get it so that it writes it where the
control is on the page?

ie

<html>
blah blah
<body>
<H1> my control </h1>
<webusercontrol:mycontrol />
<html>

at the minute if I do repsonse.write("test") in the user control it writes
like this to the client:

test
<html>
blah blah
<body>
blah blah
<H1> my control </h1>
<html>

where as I would want it to put it where the control is:

<html>
blah blah
<body>
<H1> my control </h1>
test
<html>

Thanks
Gav
Nov 15 '05 #1
3 6259
On Mon, 1 Sep 2003 21:09:10 +0100, "Gav" <sp**@spam.com> wrote:
Hi all,

I have created a user control and I am using Response.Write in the control
to 'write' exactly what I want although it always goes to the top of the
page (above <HTML><HEAD> etc). Can I get it so that it writes it where the
control is on the page?

ie

<html>
blah blah
<body>
<H1> my control </h1>
<webusercontrol:mycontrol />
<html>

at the minute if I do repsonse.write("test") in the user control it writes
like this to the client:

test
<html>
blah blah
<body>
blah blah
<H1> my control </h1>
<html>

where as I would want it to put it where the control is:

<html>
blah blah
<body>
<H1> my control </h1>
test
<html>


I'm afraid the results of response.write are returned to the client
_before_ the result of your aspx-page (the HTML generated for your
aspx-page)...

However, I would like to see my statement confirmed...

--
NULL
Nov 15 '05 #2
Write your stuff out from your Render method rather than wherever you are
writing it now (probably Page_Load).
--
Justin Rogers
DigiTec Web Consultants, LLC.

"Gav" <sp**@spam.com> wrote in message
news:uO**************@tk2msftngp13.phx.gbl...
Hi all,

I have created a user control and I am using Response.Write in the control
to 'write' exactly what I want although it always goes to the top of the
page (above <HTML><HEAD> etc). Can I get it so that it writes it where the
control is on the page?

ie

<html>
blah blah
<body>
<H1> my control </h1>
<webusercontrol:mycontrol />
<html>

at the minute if I do repsonse.write("test") in the user control it writes
like this to the client:

test
<html>
blah blah
<body>
blah blah
<H1> my control </h1>
<html>

where as I would want it to put it where the control is:

<html>
blah blah
<body>
<H1> my control </h1>
test
<html>

Thanks
Gav

Nov 15 '05 #3

Hi Gav,

There are 2 ways of writing code to client side.
One is overriding Render method, the other is using
RegisterClientScriptBlock method.

I think you can override the render method of the user control and
write your string to HtmlTextWrite.

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Gav" <sp**@spam.com>
| Subject: Response.write position
| Date: Mon, 1 Sep 2003 21:09:10 +0100
| Lines: 40
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <uO**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: pc2-grim3-3-cust103.nott.cable.ntl.com 81.99.145.103
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:181370
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi all,
|
| I have created a user control and I am using Response.Write in the control
| to 'write' exactly what I want although it always goes to the top of the
| page (above <HTML><HEAD> etc). Can I get it so that it writes it where the
| control is on the page?
|
| ie
|
| <html>
| blah blah
| <body>
| <H1> my control </h1>
| <webusercontrol:mycontrol />
| <html>
|
| at the minute if I do repsonse.write("test") in the user control it writes
| like this to the client:
|
| test
| <html>
| blah blah
| <body>
| blah blah
| <H1> my control </h1>
| <html>
|
| where as I would want it to put it where the control is:
|
| <html>
| blah blah
| <body>
| <H1> my control </h1>
| test
| <html>
|
| Thanks
| Gav
|
|
|

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lou | last post by:
I'm using the Response Filter Class in MS KB article 811162 (http://support.microsoft.com/default.aspx?scid=kb;EN-US;811162) to generate a static htm page from an asp.net template page being...
3
by: .Net Sports | last post by:
I want to include some asp if statements inside a do until loop, predicated on the recordset going until EOF. I do not have any < % %> delimiters inside the include file. The below doesnt show the...
3
by: Steve | last post by:
Hello, I'm creating an .aspx page that gets an XML document (as a string) from a server via .NET remoting and returns it in the Response.Write method. I'm saving the document to a file before I...
7
by: Shapiro | last post by:
I have a scenario where I log a resquest to a database table and update the request with a corresponding response including the response time. I am using an HttpModule to do this. My challenge...
6
by: Terry Olsen | last post by:
Is there any way to make response.write NOT be the first thing on the page? I have a page with the title and a sub title (not labels or anything, just typed into the designer). I want the...
2
by: Greg Allen | last post by:
I have a client that inherits from System.Web.Services.Protocols.SoapHttpClientProtocol. I create a proxy object and then call one of the web service methods, which returns an object. But I'd...
5
by: twiggy182 | last post by:
Hi, I really need you help because I'm not very familliar with ASP and I could not find any solution to my problem. To put you in situation, I have a CGI to which I send a file name, and that...
2
by: Michael D. Ober | last post by:
When I single step through the code below, it sends back the PDF file that is retrieved in the line fm.GetAccountPDF(...). When I run without single stepping, I get the master page for this page. ...
0
by: Leafy | last post by:
Looks like it had to do with my breakpoints. It must have slowed my transaction time causing a timeout. It just appeared that SOAPUI wasn't returning a response. Thanks! Leafy --------- ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.