473,394 Members | 1,869 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,394 software developers and data experts.

response.writing an include tag...not working?

I'm trying to load an include dynamically. So, I'm writing out the include
tag via a response.write:

response.write("<!--#include virtual='" & contentIncludeFile &"' -->")

however, that's writing out the include tag AFTER the page is processed,
obviously. Any suggestions for a way around this? Should I instead load the
contents of the include file as a string and then write that out?

-Darrel
Nov 18 '05 #1
4 1575
Can u try <%= %> and see but not sure!
"darrel" wrote:
I'm trying to load an include dynamically. So, I'm writing out the include
tag via a response.write:

response.write("<!--#include virtual='" & contentIncludeFile &"' -->")

however, that's writing out the include tag AFTER the page is processed,
obviously. Any suggestions for a way around this? Should I instead load the
contents of the include file as a string and then write that out?

-Darrel

Nov 18 '05 #2
Include directives are processed BEFORE any other server-side code and
because of this, you can't do what you are trying because the variable
"contentIncludeFile" hasn't been resolved yet.

This is not a .NET issue/question. It is how the server-side INCLUDE
directive is handled by the server.

Why not ditch "Response.Write" statements as well as INCLUDE directives and
start using .NET techniques such as labels (instead of response.write) and
User Controls (instead of SSI's)?


"darrel" <no*****@hotmail.com> wrote in message
news:OM**************@tk2msftngp13.phx.gbl...
I'm trying to load an include dynamically. So, I'm writing out the include
tag via a response.write:

response.write("<!--#include virtual='" & contentIncludeFile &"' -->")

however, that's writing out the include tag AFTER the page is processed,
obviously. Any suggestions for a way around this? Should I instead load
the
contents of the include file as a string and then write that out?

-Darrel

Nov 18 '05 #3
> Why not ditch "Response.Write" statements as well as INCLUDE directives
and start using .NET techniques such as labels (instead of response.write)
and User Controls (instead of SSI's)?


Because sometimes all you need is a response.write and an SSI. ;o)

I like .net, but really, I shouldn' have to use a UC just to include some
text.I find .net a huge improvement, but there's a lot of overkill at the
basic level.

In the end, I've got it working by opening the file, reading it into a
string, and sending the string back to the page. It works fine, but seems a
lot more complicated than a simple old include file ;o)

-Darrel
Nov 18 '05 #4
<<I shouldn' have to use a UC just to include some text.>>

Agreed, and you don't have to. Check out the Literal control. You just need
to set its Text property. The only thing that will show up on the rendered
page is the string you set for it (and in the location on the page in which
you have located the Literal control at design time).

-GH
"Darrel" <no*****@nospam.com> wrote in message
news:On**************@TK2MSFTNGP15.phx.gbl...
Why not ditch "Response.Write" statements as well as INCLUDE directives
and start using .NET techniques such as labels (instead of response.write) and User Controls (instead of SSI's)?
Because sometimes all you need is a response.write and an SSI. ;o)

I like .net, but really, I shouldn' have to use a UC just to include some
text.I find .net a huge improvement, but there's a lot of overkill at the
basic level.

In the end, I've got it working by opening the file, reading it into a
string, and sending the string back to the page. It works fine, but seems

a lot more complicated than a simple old include file ;o)

-Darrel

Nov 18 '05 #5

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

Similar topics

13
by: TinyTim | last post by:
I'm a newbie at ASP & HTML. It seems that when you use server side code and you're going to return a customized HTML form with several fields and labels, you have to do an extensive amount of...
3
by: Stefan Berglund | last post by:
This may not be the right group for this since the ASP part of the equation seems to be working as it should, but at the very least perhaps someone will point me to the correct group or even...
5
by: zambak | last post by:
Hi I have assignment for some wierd compression alghoritam that will read in from a file convert characters to 5 bit codes and then write out compressed version of the original file. For...
1
by: xoinki | last post by:
hi experts, I need a little help in debugging this code.. would u pleeze kindly help me? here this program sends a datagram every 10 seconds and on reception it cheks whether the source IP is...
6
by: john | last post by:
The standard method to transmit a file from an aspx page to a browser is to stream the file to the response then end the response. The HTML code generated by the aspx page is discarded, and the...
3
by: Jer425 | last post by:
Hello all, I'm trying to post to another page from asp.net and direct the user there. I've looked through the group and found a lot of information. The following code may work well for what I'm...
0
by: ed | last post by:
Hello All. I have seen many posts slightly similar to this question with no answer. Maybe you have some FAQs or something, sorry if I looks repetitive. Here is my Problem: In my...
1
by: auctiontrading | last post by:
Hi all I have a method that will run through a lot of data and write it out. I am simply writing the data out as response.write(). The problem I am having is that the the response does not show...
14
by: S N | last post by:
I am using the following code to hide the download url of files on my website. The code uses Response.Binarywrite to send file to the client. Kindly indicate the maximum size of the file that can be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.