473,406 Members | 2,345 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,406 software developers and data experts.

As expected?

I did not expect this to work as expected:

<%
function a()
%>ha !<br><%
end function

a
a
a
a
a
%>

So, why do we use so much response.writes?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #1
3 1318
Mixing HTML and VBScript code is generally considered as less easier to
read. For example if you want to use a variable instead of ! you'll have
something like :

Sub a(ByVal Mark)
%><!--ha--><%=Mark%><br><%
End Sub

Opposed to :

Sub a(ByVal Mark)
Response.Write("ha ")
Response.Write(Mark)
Response.Write("<br>")
End Sub

Patrice

"Evertjan." <ex**************@interxnl.net> a écrit dans le message de
news:Xn********************@194.109.133.29...
I did not expect this to work as expected:

<%
function a()
%>ha !<br><%
end function

a
a
a
a
a
%>

So, why do we use so much response.writes?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #2
I agree with Patrice, it's easier to read.

In some projects I have used a shortcut function like this:

function rw(s)
response.write s
end function

rw "Hello"
rw "Goodbye"

I have also used wl, which mimicked writeline (adding carriage returns /
<br> etc. so I didn't have to think about putting the HTML into the text).

I think another factor is that many people are in the habit of avoiding
context switching because IIS *used* to be a bit inefficient with it.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
I did not expect this to work as expected:

<%
function a()
%>ha !<br><%
end function

a
a
a
a
a
%>

So, why do we use so much response.writes?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #3
Evertjan. wrote:
I did not expect this to work as expected:

<%
function a()
%>ha !<br><%
end function

a
a
a
a
a
%>

So, why do we use so much response.writes?

Some Microsoft URLs term the above a "render function", e.g.,:
"Migrating to ASP.NET: Key Considerations" by Jim Kieley:
http://msdn.microsoft.com/library/de...migrissues.asp

According to that Microsoft article and others, "render functions" are
not allowed in ASP.NET, which is unfortunate. Personally I think they're
kinda cute and handy, yet another reason to use ASP instead of ASP.NET.
Jul 19 '05 #4

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

Similar topics

4
by: Bill | last post by:
I call a function in my .js file like this: onClick="location.href='blank.html' + generateSearchStringFromForm('section')" where section is the name of my form. The function is defined as...
5
by: andy.herrera | last post by:
I'm getting this Error Message. Expected ';' Please Select One: <form name="form1"> <<------------ Error is here. <select name="selectTrans" onChange="If (this.value == 'checkout')...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
7
by: Warrax | last post by:
I am currently doing online tutorials for C++, and am pretty much stuck in a rut about this problem. It is saying that there's an expected unqualifed-id before '{' token (I will post the code in just...
1
by: JOJO123 | last post by:
I got here in search of an answer to this Javascrpt question. I upgraded jave on XP Ie 7, acrobat 5.1 and suddenly can't open any pdf files on web sites using IE. I see u guys all say, this is a...
6
by: Lawrence Spector | last post by:
I ran into a problem using g++. Visual Studio 2005 never complained about this, but with g++ I ran into this error. I can't figure out if I've done something wrong or if this is a compiler bug. ...
5
by: amitmool | last post by:
hi, i have used the queue library file and try to use the template as template <class QueueItem> queue <QueueItem>::~queue() // line 25 { } template <class QueueItem> void...
1
by: Hunternora | last post by:
I'm just trying to count letters, by type etc. What am I doing wrong here? import javax.swing.JOptionPane; public class Asg3 { public static void main(String args) { int aCount=0,...
10
by: preeya | last post by:
Hi, I have written the following program: ------------------------------------------------------------------------------------------------------------- 1 #include <stdio.h> 2 #include...
9
by: erictheone | last post by:
Ok so what I'm trying to do is create a trans location cipher. For those among us that don't know alot about cryptography it is a method for jumbling up letters to disguise linguistic...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.