473,714 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Lots of Response.Writes of HTML - How do YOU do it?

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
Response.Writes .

Are there any tools that will let you design the form then convert
that form to Response.Writes that you can further customize with ASP
logic? For instance: use Dreamweaver to design the form, then another
program to convert to response.writes in an aspx file.

What's the easy way of doing it? Just trying to make it less
laborious for me.

Response.Write "Thanks,"

tt

Jul 19 '05 #1
13 4747
That's an interesting question. However, it is only the dynamic parts of the
HTML that you need to worry about.

The rest of it, you can put in the ASP as is simply by closing the brackets.

eg.

<%
whatever = ...
Response.Write( whatever)
%>
<form>
blah blah blah
</form>
<%
...
%>

You can also use =expression as shorthand for writing an expression if it is
the entire code within brackets.

For example <%=whatever%> instead of <%Response.Writ e(whatever)%>

Does that help?

Paul

"TinyTim" <Ti*****@MissVi cky.com> wrote in message
news:ar******** *************** *********@4ax.c om...
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
Response.Writes .

Are there any tools that will let you design the form then convert
that form to Response.Writes that you can further customize with ASP
logic? For instance: use Dreamweaver to design the form, then another
program to convert to response.writes in an aspx file.

What's the easy way of doing it? Just trying to make it less
laborious for me.

Response.Write "Thanks,"

tt

Jul 19 '05 #2
TinyTim wrote:
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
Response.Writes .


Are you aware that this...
<%=myVar%>

....is a lexical shorthand for this?
<% Response.Write( myVar) %>
Most of my documents are written so the HTML is a single continuous section,
dotted with tokens. Form element examples:

<input name="LastName" value="<%=Page. LastName%>">
<select name="Role"><%= Page.RoleOption List%></select>
<textarea name="Comments" ><%=Page.Commen ts%></textarea>

The logic for populating the variables has been abstracted away to a
server-side-only segment of the script, and the above displays just fine in
a tool like Dreamweaver.
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #3
I'm looking at Snitz forum code for my examples, one of which I
included in this post. Even with your described methods, it seems
like a lot of work, having to design the page layout manually then
putting the appropriate quote marks, underscores, etc in code.
For example <%=whatever%> instead of <%Response.Writ e(whatever)%> I'll be checking this method out on one of the online tutorials. Can
you point me to a specific tutorial?

Thanks,

tt

'--------------- Code Snippet Follows --------------------------------
else
Response.Write " <p><font face=""" & strDefaultFontF ace
& """ size=""" & strHeaderFontSi ze & """>You do not have permission to
change another users subscription. Only Administrators may change
another users subscriptions.</font></p>" & vbNewline

' ## This is just the form which is used to login if the
person is
' ## not logged in or does not have access to do the
moderation.
Response.Write " <form
action=""pop_su bscription.asp? UserCheck=Y"" method=""post""
id=""Form1"" name=""Form1""> " & vbNewline & _
" <input type=""hidden""
name=""REPLY_ID "" value=""" & ReplyID & """>" & vbNewline & _
" <input type=""hidden""
name=""TOPIC_ID "" value=""" & TopicID & """>" & vbNewline & _
" <input type=""hidden""
name=""FORUM_ID "" value=""" & ForumID & """>" & vbNewline & _
" <input type=""hidden"" name=""CAT_ID""
value=""" & CatID & """>" & vbNewline & _
" <table border=""0"" width=""75%""
cellspacing=""0 "" cellpadding=""0 "">" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgcolor=""" &
strPopUpBorderC olor & """>" & vbNewline & _
" <table border=""0""
width=""100%"" cellspacing=""1 "" cellpadding=""1 "">" & vbNewline
if strAuthType = "db" then
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableCo lor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontF ace & """ size=""" & strDefaultFontS ize & """>User
Name:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableCo lor & """><input type=""text"" name=""name"" value="""
& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableCo lor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontF ace & """ size=""" & strDefaultFontS ize &
""">Passwor d:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableCo lor & """><input type=""password "" name=""password ""
value="""" size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
else
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableCo lor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontF ace & """ size=""" & strDefaultFontS ize & """>NT
Account:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableCo lor & """><input type=""text"" name=""DBNTUser Name""
value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
end if
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableCo lor & """ colspan=""2"" align=""center" "><Input
type=""Submit"" value=""Send"" id=""Submit1"" name=""Submit1" "></td>"
& vbNewline & _
" </tr>" & vbNewline & _
" </table>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" </table>" & vbNewline & _
" </form>" & vbNewline
end if
'--------------- End of Code Snippet --------------------------------

On Wed, 11 Aug 2004 17:35:18 -0400, "Paul Baker [MVP, Windows - SDK]"
<pa***@online.r ochester.rr.com > wrote:
That's an interesting question. However, it is only the dynamic parts of the
HTML that you need to worry about.

The rest of it, you can put in the ASP as is simply by closing the brackets.

eg.

<%
whatever = ...
Response.Write( whatever)
%>
<form>
blah blah blah
</form>
<%
...
%>

You can also use =expression as shorthand for writing an expression if it is
the entire code within brackets.

For example <%=whatever%> instead of <%Response.Writ e(whatever)%>

Does that help?

Paul

"TinyTim" <Ti*****@MissVi cky.com> wrote in message
news:ar******* *************** **********@4ax. com...
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
Response.Writes .

Are there any tools that will let you design the form then convert
that form to Response.Writes that you can further customize with ASP
logic? For instance: use Dreamweaver to design the form, then another
program to convert to response.writes in an aspx file.

What's the easy way of doing it? Just trying to make it less
laborious for me.

Response.Write "Thanks,"

tt


Jul 19 '05 #4
Can you a more complete example or tutorial? I seem to be a bit
thick-headed on this subject. Also please see my response to the
previous message in this thread.

tt

On Wed, 11 Aug 2004 16:56:19 -0500, "Dave Anderson"
<GT**********@s pammotel.com> wrote:
TinyTim wrote:
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
Response.Writes .


Are you aware that this...
<%=myVar%>

...is a lexical shorthand for this?
<% Response.Write( myVar) %>
Most of my documents are written so the HTML is a single continuous section,
dotted with tokens. Form element examples:

<input name="LastName" value="<%=Page. LastName%>">
<select name="Role"><%= Page.RoleOption List%></select>
<textarea name="Comments" ><%=Page.Commen ts%></textarea>

The logic for populating the variables has been abstracted away to a
server-side-only segment of the script, and the above displays just fine in
a tool like Dreamweaver.


Jul 19 '05 #5
On Wed, 11 Aug 2004 15:35:42 -0700, TinyTim <Ti*****@MissVi cky.com>
wrote:
I'm looking at Snitz forum code for my examples, one of which I
included in this post. Even with your described methods, it seems
like a lot of work, having to design the page layout manually then
putting the appropriate quote marks, underscores, etc in code.
For example <%=whatever%> instead of <%Response.Writ e(whatever)%>I'll be checking this method out on one of the online tutorials. Can
you point me to a specific tutorial?

Thanks,

tt


Welcome to the world of web development where typing is essential :)

I have a Include file that I include into EVERY .asp page, this file
has several functions that I use things like:

out(); // I use this instead of Response.Write
debugOut() // this is to display variable data etc. and if I
forget to take it out its not shown on the live server.
onLocalServer() ; // this returns true if the site is running on my
test server

I'll include the file below incase its of any interest to you. Note
that its all in JScript. Sorry for all the tabs, I can't be bothered
to change them to spaces. copy & paste into notepad.

HTH

Al
<%
//*************** *************** *************** *************** *************** ****
//* F U N C T I O N S / S U B S
//*************** *************** *************** *************** *************** ****
var g_bDebug; // t/f whether in debugging mode or not.

//*************** *************** *************** *************** *************** ****
/* This function to saftly convert a VBscript array into a JS 1
Dimension array
a VBscript array will normally be returned when using the ADO
"Recordset.GetR ows()" method - like in the clsDBErrorCheck er.asp File
it adds 2 custom properties to the Jscript Array called
"numberOfRo ws" &
"numberOfColumn s" if no array is return from the RS.GetRows() method
(eg a DBerror)
then it will return a "string" which this JS function detects and
returns an
array with nothing in it so check if arrayname.lengt h >0 before use.
*/

function VB_JSarray(aVBA rrayFromDBCheck _OpenIntoArrayM ethod,
displayDebugInf o) {
if (typeof aVBArrayFromDBC heck_OpenIntoAr rayMethod !=
'string') {
vbRowsArray = new
VBArray(aVBArra yFromDBCheck_Op enIntoArrayMeth od);
var numberOfColumns = vbRowsArray.ubo und(1) + 1;
var numberOfRows = vbRowsArray.ubo und(2) + 1;
var rowsArray = vbRowsArray.toA rray();
rowsArray.rows = numberOfRows;
rowsArray.cols = numberOfColumns ;
if (displayDebugIn fo) {
debugOut('{HEAD }VB_JSarray()', 'Rows=' +
rowsArray.rows, 'Columns=' + rowsArray.cols, 'rowsArray=' +
rowsArray);
}
} else {
var rowsArray = Array();
rowsArray.rows = 0;
rowsArray.cols = 0;
}
return rowsArray;
}
//*************** *************** *************** *************** *************** ****
// Are we in debug mode?
function inDebugMode() {
if (typeof g_bDebug == 'undefined') {
g_bDebug = false;
if (onLocalServer( ) ||
Request.QuerySt ring('debug').C ount > 0) {
g_bDebug = true;
}
}
return g_bDebug;
}

// This debug accepts any amount of arguments with no [] around the
text
// and creates a long html string accordingly to display the info.
function debugOut() {
if (inDebugMode()) {
var sDebugWord = 'GUBED';
var sOutput = sDebugWord, sText='';

if (arguments.leng th < 1) {
sOutput += '<span style="backgrou nd:#555;
color:#CCC; font: bold italic 12px Comic Sans MS, Verdana;">{NO
ARGUMENTS FOR THE DEBUG FUNCTION}&nbsp; </span>';
} else {
for (var i = 0; i < arguments.lengt h; i++) {
sText = String(argument s[i]).trim();
// If blank text or <br> text then
display a blank line
if (sText && sText != '' && sText !=
'<br>' && sText != '\r\n') {
// Do the debug title.
if
(sText.toUpperC ase().substring (0, 6) == '{HEAD}') {
sText =
sText.toUpperCa se();
}
// highlight the "=" sign.
This is done first as the "=" sign appears in all the
// properties of HTML (eg
style="")
sText = sText.replace(/=/g,
'<span style="font-weight:bold; color:#F90;">=</span>');
// If its a Header debugOut
then change color.
if (sText.substrin g(0, 6) ==
'{HEAD}') {
sText = '<span
style="font-weight:bold; color:#CCC;">' + sText.substring (6) +
'</span>';
}
// If its a highlight debugOut
then change the color from the default.
sText =
sText.replace(/{HIGH}/gi, '<span style="color:#F 90; font: bold 12px
Verdana;">');
sText =
sText.replace(/{\/HIGH}/gi, '</span>');

// if the text isn't
surrounded with {...} then add the brackets to the
// front and the back of the
string
if (sText.charAt(0 ) != '{') {
sText = '{' + sText;
}
if
(sText.charAt(s Text.length-1) != '}') {
sText += '}';
}

// if there is no info after
the "=" then insert word "EMPTY"
sText =
sText.replace(' =</span>}', '=</span><span style="font: bold 12px
Verdana;; color:#C00;">EM PTY</span>}');

var sText = '<span
style="backgrou nd:#555; color:#0BB; font:12px Verdana;">' + sText +
'&nbsp;</span>' ;
// If there is more than 5
elements then wrap the output every 5 elements.
if (i % 5 == 4 && i !=
arguments.lengt h-1) {
sText += sDebugWord;
}
// Add the created string to
the total output string
sOutput += sText;
} else {
sOutput += '<br>';
}
}

}
// Change all the [.] & {.} in the output string to a
differnt color so they stand
// out better from the rest
sOutput = sOutput.replace (/(\[|\])/g,'<span
style="font-weight:bold; color:#0CC;">$1 </span>');

sOutput = sOutput.replace (/(\{|\})/g,'<span
style="font-weight:bold; color:#FC0;">$1 </span>');
// Change the word {DEBUG} so the debug title stands
out better.
sOutput = sOutput.replace (/GUBED/g,'<br><span
style="backgrou nd:#600; color:#C00; font: bold 12px Comic Sans MS,
Verdana;">&nbsp ;{&nbsp;DEBUG&n bsp;}&nbsp;</span>');
// Output the final string.
out(sOutput);
}
}

//*************** *************** *************** *************** *************** ****
// only display when in debug mode as defined in inDebugMode() above
// this is to add a touch of color to any debug strings.
function debugHighlight( sText) {
if (inDebugMode()) {
if (sText && sText != '') {
sText = '{HIGH}' + sText.trim() + '{/HIGH}';
}
}
return sText;
}

//*************** *************** *************** *************** *************** ****
// Justs puts a comment to the HTML file for easy reading
function debugOutHeader( sHeader, bMainHeader) {
var sNewHead = '', sTxt;

if (inDebugMode()) {
sHeader = String(sHeader) .toUpperCase() || "No Header
Text";
if (sHeader.length > 0 ) {
if (bMainHeader) {
for (var i = 0; i < sHeader.length;
i++) {
sNewHead += sHeader.charAt( i)
+ ' ';
if (sHeader.charAt (i) == ' ')
{
sNewHead += ' ';
}
}
sNewHead=sNewHe ad.trim();
sTxt = '\r\n<!--\r\n';
sTxt +=
'************** *************** *************** *************** *\r\n';
sTxt += '************** * ' + sNewHead
+ ' *************** \r\n';
sTxt +=
'************** *************** *************** *************** *\r\n';
sTxt += '-->\r\n';
} else {
sNewHead = sHeader;
sTxt = '\r\n<!-- [DebugHeader]
********** ' + sNewHead + ' ********** -->\r\n';
}
out(sTxt);
}
}
}

//*************** *************** *************** *************** *************** ****
// simple wrapper for Response.Write,
function out(sText) {
Response.Write (sText);
if (inDebugMode()) {
Response.Write ('\r\n');
}
}

//*************** *************** *************** *************** *************** ****
// OutJS is mainly used for outputting JS files as these are easier
with
// returns & linefeeds.
function outJS(sText) {
Response.Write (sText + '\r\n');
}

//*************** *************** *************** *************** *************** ****
// use Response.Redire ct or Server.Transfer depending on ASP version
function redirect(sDesti nation) {
// use expensive round-trip redirect always
// Server.Transfer caused problems
Response.Redire ct (sDestination);
}
//*************** *************** *************** *************** *************** ****
// to return the html code for a transparent image of iWidth, iHeight
function pixelImage(iWid th, iHeight) {
if (iWidth < 1 || !iWidth) {
iWidth = 1;
}
if (iHeight < 1 || !iHeight) {
iHeight = 1;
}
return '<img src="/Images/Pixel.gif" width="' + iWidth + '"
height="' + iHeight + '" alt="" border="0">';
}

//*************** *************** *************** *************** *************** ****
function closeWindow(bCe ntered) {
var sText = '';
if (bCentered) {
sText = '<div style="text-align:center; margin:10px;
2px;">';
}
sText += '<span class="Font01">[&nbsp;<a href="#"
onclick="window .close(); return false;">Close
Window</a>&nbsp;]</span>';
if (bCentered) {
sText += '</div>';
}
return sText;
}

//*************** *************** *************** *************** *************** ****
function closeWindowAndO pener(bCentered ) {
var sText = '';
if (bCentered) {
sText = '<div style="text-align:center; margin:10px;
2px;">';
}
sText += '<span class="Font01">[&nbsp;<a href="#"
onclick="window .close(); window.opener.c lose();return false;">Close
Window</a>&nbsp;]</span>';
if (bCentered) {
sText += '</div>';
}
return sText;
}

//*************** *************** *************** *************** *************** ****
function userErrorMessag e(sErrorText) {
// Note you need the SFX.CSS file included for this to look
right.
return '<div class="bg900 Bordered Font02" style="padding: 0em
1em; text-indent: -1em;"><span class="bg600 Font04" style="color:#C 00;
font-weight: bold;">&nbsp;ER ROR:&nbsp;</span>&nbsp;' + sErrorText +
'</div>';
}

//*************** *************** *************** *************** *************** ****
// Convert a string to a Base10 number, if it cannot be converted then
return
// the devault value. This is used to make sure that input from web
forms are
// actually numbers and not string... eg Age, quantity. etc.
function convertToNumber (sString, iDefault) {
var iNewVal = parseFloat(sStr ing, 10) || iDefault || 0;
sString = (''+sString).to LowerCase();

if (sString == 'true' || sString == 'yes' || sString == 'on')
{
iNewVal = true;
}
if (sString == 'false' || sString == 'no' || sString == 'off')
{
iNewVal = false;
}
if (isNaN(iNewVal) ) {
iNewVal = iDefault;
}
return iNewVal;
}

//*************** *************** *************** *************** *************** ****
//*************** *************** *************** *************** *************** ****
//*************** *************** *************** *************** *************** ****
//*************** *************** *************** *************** *************** ****
//*************** *************** *************** *************** *************** ****
%>

'--------------- Code Snippet Follows --------------------------------
else
Response.Write " <p><font face=""" & strDefaultFontF ace
& """ size=""" & strHeaderFontSi ze & """>You do not have permission to
change another users subscription. Only Administrators may change
another users subscriptions.</font></p>" & vbNewline

' ## This is just the form which is used to login if the
person is
' ## not logged in or does not have access to do the
moderation.
Response.Write " <form
action=""pop_s ubscription.asp ?UserCheck=Y"" method=""post""
id=""Form1"" name=""Form1""> " & vbNewline & _
" <input type=""hidden""
name=""REPLY_I D"" value=""" & ReplyID & """>" & vbNewline & _
" <input type=""hidden""
name=""TOPIC_I D"" value=""" & TopicID & """>" & vbNewline & _
" <input type=""hidden""
name=""FORUM_I D"" value=""" & ForumID & """>" & vbNewline & _
" <input type=""hidden"" name=""CAT_ID""
value=""" & CatID & """>" & vbNewline & _
" <table border=""0"" width=""75%""
cellspacing="" 0"" cellpadding=""0 "">" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgcolor=""" &
strPopUpBorder Color & """>" & vbNewline & _
" <table border=""0""
width=""100% "" cellspacing=""1 "" cellpadding=""1 "">" & vbNewline
if strAuthType = "db" then
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFont Face & """ size=""" & strDefaultFontS ize & """>User
Name:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """><input type=""text"" name=""name"" value="""
& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFont Face & """ size=""" & strDefaultFontS ize &
""">Password :</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """><input type=""password "" name=""password ""
value="""" size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
else
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFont Face & """ size=""" & strDefaultFontS ize & """>NT
Account:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """><input type=""text"" name=""DBNTUser Name""
value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
end if
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """ colspan=""2"" align=""center" "><Input
type=""Submit" " value=""Send"" id=""Submit1"" name=""Submit1" "></td>"
& vbNewline & _
" </tr>" & vbNewline & _
" </table>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" </table>" & vbNewline & _
" </form>" & vbNewline
end if
'--------------- End of Code Snippet --------------------------------

On Wed, 11 Aug 2004 17:35:18 -0400, "Paul Baker [MVP, Windows - SDK]"
<pa***@online. rochester.rr.co m> wrote:
That's an interesting question. However, it is only the dynamic parts of the
HTML that you need to worry about.

The rest of it, you can put in the ASP as is simply by closing the brackets.

eg.

<%
whatever = ...
Response.Write( whatever)
%>
<form>
blah blah blah
</form>
<%
...
%>

You can also use =expression as shorthand for writing an expression if it is
the entire code within brackets.

For example <%=whatever%> instead of <%Response.Writ e(whatever)%>

Does that help?

Paul

"TinyTim" <Ti*****@MissVi cky.com> wrote in message
news:ar****** *************** ***********@4ax .com...
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
Response.Writes .

Are there any tools that will let you design the form then convert
that form to Response.Writes that you can further customize with ASP
logic? For instance: use Dreamweaver to design the form, then another
program to convert to response.writes in an aspx file.

What's the easy way of doing it? Just trying to make it less
laborious for me.

Response.Write "Thanks,"

tt


Jul 19 '05 #6
I see that you asked both myself and Dave for tutorials on this.

I am not sure what you are getting at. You don't need a tutorial, you just
need to learn this one thing:
<%=expression %> is shorthand for <%Response.Writ e(expression)%>

So, if you find yourself typing "<%Response.Wri te(expression)% >", type
"<%=expression% >" instead. That is all there is to it. What is it you are
unsure about?

Paul

"TinyTim" <Ti*****@MissVi cky.com> wrote in message
news:jr******** *************** *********@4ax.c om...
Can you a more complete example or tutorial? I seem to be a bit
thick-headed on this subject. Also please see my response to the
previous message in this thread.

tt

On Wed, 11 Aug 2004 16:56:19 -0500, "Dave Anderson"
<GT**********@s pammotel.com> wrote:
TinyTim wrote:
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
Response.Writes .


Are you aware that this...
<%=myVar%>

...is a lexical shorthand for this?
<% Response.Write( myVar) %>
Most of my documents are written so the HTML is a single continuous section,dotted with tokens. Form element examples:

<input name="LastName" value="<%=Page. LastName%>">
<select name="Role"><%= Page.RoleOption List%></select>
<textarea name="Comments" ><%=Page.Commen ts%></textarea>

The logic for populating the variables has been abstracted away to a
server-side-only segment of the script, and the above displays just fine ina tool like Dreamweaver.

Jul 19 '05 #7
Thanks,

tt

On Thu, 12 Aug 2004 11:01:02 +0100, Harag
<ha************ **********@soft home.net> wrote:
On Wed, 11 Aug 2004 15:35:42 -0700, TinyTim <Ti*****@MissVi cky.com>
wrote:
I'm looking at Snitz forum code for my examples, one of which I
included in this post. Even with your described methods, it seems
like a lot of work, having to design the page layout manually then
putting the appropriate quote marks, underscores, etc in code.
For example <%=whatever%> instead of <%Response.Writ e(whatever)%>

I'll be checking this method out on one of the online tutorials. Can
you point me to a specific tutorial?

Thanks,

tt


Welcome to the world of web development where typing is essential :)

I have a Include file that I include into EVERY .asp page, this file
has several functions that I use things like:

out(); // I use this instead of Response.Write
debugOut() // this is to display variable data etc. and if I
forget to take it out its not shown on the live server.
onLocalServer( ); // this returns true if the site is running on my
test server

I'll include the file below incase its of any interest to you. Note
that its all in JScript. Sorry for all the tabs, I can't be bothered
to change them to spaces. copy & paste into notepad.

HTH

Al
<%
//*************** *************** *************** *************** *************** ****
//* F U N C T I O N S / S U B S
//*************** *************** *************** *************** *************** ****
var g_bDebug; // t/f whether in debugging mode or not.

//*************** *************** *************** *************** *************** ****
/* This function to saftly convert a VBscript array into a JS 1
Dimension array
a VBscript array will normally be returned when using the ADO
"Recordset.GetR ows()" method - like in the clsDBErrorCheck er.asp File
it adds 2 custom properties to the Jscript Array called
"numberOfRow s" &
"numberOfColumn s" if no array is return from the RS.GetRows() method
(eg a DBerror)
then it will return a "string" which this JS function detects and
returns an
array with nothing in it so check if arrayname.lengt h >0 before use.
*/

function VB_JSarray(aVBA rrayFromDBCheck _OpenIntoArrayM ethod,
displayDebugIn fo) {
if (typeof aVBArrayFromDBC heck_OpenIntoAr rayMethod !=
'string') {
vbRowsArray = new
VBArray(aVBArr ayFromDBCheck_O penIntoArrayMet hod);
var numberOfColumns = vbRowsArray.ubo und(1) + 1;
var numberOfRows = vbRowsArray.ubo und(2) + 1;
var rowsArray = vbRowsArray.toA rray();
rowsArray.rows = numberOfRows;
rowsArray.cols = numberOfColumns ;
if (displayDebugIn fo) {
debugOut('{HEAD }VB_JSarray()', 'Rows=' +
rowsArray.rows , 'Columns=' + rowsArray.cols, 'rowsArray=' +
rowsArray);
}
} else {
var rowsArray = Array();
rowsArray.rows = 0;
rowsArray.cols = 0;
}
return rowsArray;
}
//*************** *************** *************** *************** *************** ****
// Are we in debug mode?
function inDebugMode() {
if (typeof g_bDebug == 'undefined') {
g_bDebug = false;
if (onLocalServer( ) ||
Request.QueryS tring('debug'). Count > 0) {
g_bDebug = true;
}
}
return g_bDebug;
}

// This debug accepts any amount of arguments with no [] around the
text
// and creates a long html string accordingly to display the info.
function debugOut() {
if (inDebugMode()) {
var sDebugWord = 'GUBED';
var sOutput = sDebugWord, sText='';

if (arguments.leng th < 1) {
sOutput += '<span style="backgrou nd:#555;
color:#CCC; font: bold italic 12px Comic Sans MS, Verdana;">{NO
ARGUMENTS FOR THE DEBUG FUNCTION}&nbsp; </span>';
} else {
for (var i = 0; i < arguments.lengt h; i++) {
sText = String(argument s[i]).trim();
// If blank text or <br> text then
display a blank line
if (sText && sText != '' && sText !=
'<br>' && sText != '\r\n') {
// Do the debug title.
if
(sText.toUpper Case().substrin g(0, 6) == '{HEAD}') {
sText =
sText.toUpperC ase();
}
// highlight the "=" sign.
This is done first as the "=" sign appears in all the
// properties of HTML (eg
style="")
sText = sText.replace(/=/g,
'<span style="font-weight:bold; color:#F90;">=</span>');
// If its a Header debugOut
then change color.
if (sText.substrin g(0, 6) ==
'{HEAD}') {
sText = '<span
style="font-weight:bold; color:#CCC;">' + sText.substring (6) +
'</span>';
}
// If its a highlight debugOut
then change the color from the default.
sText =
sText.replac e(/{HIGH}/gi, '<span style="color:#F 90; font: bold 12px
Verdana;">') ;
sText =
sText.replac e(/{\/HIGH}/gi, '</span>');

// if the text isn't
surrounded with {...} then add the brackets to the
// front and the back of the
string
if (sText.charAt(0 ) != '{') {
sText = '{' + sText;
}
if
(sText.charAt( sText.length-1) != '}') {
sText += '}';
}

// if there is no info after
the "=" then insert word "EMPTY"
sText =
sText.replace( '=</span>}', '=</span><span style="font: bold 12px
Verdana;; color:#C00;">EM PTY</span>}');

var sText = '<span
style="backgro und:#555; color:#0BB; font:12px Verdana;">' + sText +
'&nbsp;</span>' ;
// If there is more than 5
elements then wrap the output every 5 elements.
if (i % 5 == 4 && i !=
arguments.leng th-1) {
sText += sDebugWord;
}
// Add the created string to
the total output string
sOutput += sText;
} else {
sOutput += '<br>';
}
}

}
// Change all the [.] & {.} in the output string to a
differnt color so they stand
// out better from the rest
sOutput = sOutput.replace (/(\[|\])/g,'<span
style="font-weight:bold; color:#0CC;">$1 </span>');

sOutput = sOutput.replace (/(\{|\})/g,'<span
style="font-weight:bold; color:#FC0;">$1 </span>');
// Change the word {DEBUG} so the debug title stands
out better.
sOutput = sOutput.replace (/GUBED/g,'<br><span
style="backgro und:#600; color:#C00; font: bold 12px Comic Sans MS,
Verdana;">&nbs p;{&nbsp;DEBUG& nbsp;}&nbsp;</span>');
// Output the final string.
out(sOutput);
}
}

//*************** *************** *************** *************** *************** ****
// only display when in debug mode as defined in inDebugMode() above
// this is to add a touch of color to any debug strings.
function debugHighlight( sText) {
if (inDebugMode()) {
if (sText && sText != '') {
sText = '{HIGH}' + sText.trim() + '{/HIGH}';
}
}
return sText;
}

//*************** *************** *************** *************** *************** ****
// Justs puts a comment to the HTML file for easy reading
function debugOutHeader( sHeader, bMainHeader) {
var sNewHead = '', sTxt;

if (inDebugMode()) {
sHeader = String(sHeader) .toUpperCase() || "No Header
Text";
if (sHeader.length > 0 ) {
if (bMainHeader) {
for (var i = 0; i < sHeader.length;
i++) {
sNewHead += sHeader.charAt( i)
+ ' ';
if (sHeader.charAt (i) == ' ')
{
sNewHead += ' ';
}
}
sNewHead=sNewHe ad.trim();
sTxt = '\r\n<!--\r\n';
sTxt +=
'************* *************** *************** *************** **\r\n';
sTxt += '************** * ' + sNewHead
+ ' *************** \r\n';
sTxt +=
'************* *************** *************** *************** **\r\n';
sTxt += '-->\r\n';
} else {
sNewHead = sHeader;
sTxt = '\r\n<!-- [DebugHeader]
********** ' + sNewHead + ' ********** -->\r\n';
}
out(sTxt);
}
}
}

//*************** *************** *************** *************** *************** ****
// simple wrapper for Response.Write,
function out(sText) {
Response.Write (sText);
if (inDebugMode()) {
Response.Write ('\r\n');
}
}

//*************** *************** *************** *************** *************** ****
// OutJS is mainly used for outputting JS files as these are easier
with
// returns & linefeeds.
function outJS(sText) {
Response.Write (sText + '\r\n');
}

//*************** *************** *************** *************** *************** ****
// use Response.Redire ct or Server.Transfer depending on ASP version
function redirect(sDesti nation) {
// use expensive round-trip redirect always
// Server.Transfer caused problems
Response.Redire ct (sDestination);
}
//*************** *************** *************** *************** *************** ****
// to return the html code for a transparent image of iWidth, iHeight
function pixelImage(iWid th, iHeight) {
if (iWidth < 1 || !iWidth) {
iWidth = 1;
}
if (iHeight < 1 || !iHeight) {
iHeight = 1;
}
return '<img src="/Images/Pixel.gif" width="' + iWidth + '"
height="' + iHeight + '" alt="" border="0">';
}

//*************** *************** *************** *************** *************** ****
function closeWindow(bCe ntered) {
var sText = '';
if (bCentered) {
sText = '<div style="text-align:center; margin:10px;
2px;">';
}
sText += '<span class="Font01">[&nbsp;<a href="#"
onclick="windo w.close(); return false;">Close
Window</a>&nbsp;]</span>';
if (bCentered) {
sText += '</div>';
}
return sText;
}

//*************** *************** *************** *************** *************** ****
function closeWindowAndO pener(bCentered ) {
var sText = '';
if (bCentered) {
sText = '<div style="text-align:center; margin:10px;
2px;">';
}
sText += '<span class="Font01">[&nbsp;<a href="#"
onclick="windo w.close(); window.opener.c lose();return false;">Close
Window</a>&nbsp;]</span>';
if (bCentered) {
sText += '</div>';
}
return sText;
}

//*************** *************** *************** *************** *************** ****
function userErrorMessag e(sErrorText) {
// Note you need the SFX.CSS file included for this to look
right.
return '<div class="bg900 Bordered Font02" style="padding: 0em
1em; text-indent: -1em;"><span class="bg600 Font04" style="color:#C 00;
font-weight: bold;">&nbsp;ER ROR:&nbsp;</span>&nbsp;' + sErrorText +
'</div>';
}

//*************** *************** *************** *************** *************** ****
// Convert a string to a Base10 number, if it cannot be converted then
return
// the devault value. This is used to make sure that input from web
forms are
// actually numbers and not string... eg Age, quantity. etc.
function convertToNumber (sString, iDefault) {
var iNewVal = parseFloat(sStr ing, 10) || iDefault || 0;
sString = (''+sString).to LowerCase();

if (sString == 'true' || sString == 'yes' || sString == 'on')
{
iNewVal = true;
}
if (sString == 'false' || sString == 'no' || sString == 'off')
{
iNewVal = false;
}
if (isNaN(iNewVal) ) {
iNewVal = iDefault;
}
return iNewVal;
}

//*************** *************** *************** *************** *************** ****
//*************** *************** *************** *************** *************** ****
//*************** *************** *************** *************** *************** ****
//*************** *************** *************** *************** *************** ****
//*************** *************** *************** *************** *************** ****
%>

'--------------- Code Snippet Follows --------------------------------
else
Response.Write " <p><font face=""" & strDefaultFontF ace
& """ size=""" & strHeaderFontSi ze & """>You do not have permission to
change another users subscription. Only Administrators may change
another users subscriptions.</font></p>" & vbNewline

' ## This is just the form which is used to login if the
person is
' ## not logged in or does not have access to do the
moderation.
Response.Write " <form
action=""pop_ subscription.as p?UserCheck=Y"" method=""post""
id=""Form1" " name=""Form1""> " & vbNewline & _
" <input type=""hidden""
name=""REPLY_ ID"" value=""" & ReplyID & """>" & vbNewline & _
" <input type=""hidden""
name=""TOPIC_ ID"" value=""" & TopicID & """>" & vbNewline & _
" <input type=""hidden""
name=""FORUM_ ID"" value=""" & ForumID & """>" & vbNewline & _
" <input type=""hidden"" name=""CAT_ID""
value=""" & CatID & """>" & vbNewline & _
" <table border=""0"" width=""75%""
cellspacing=" "0"" cellpadding=""0 "">" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgcolor=""" &
strPopUpBorde rColor & """>" & vbNewline & _
" <table border=""0""
width=""100%" " cellspacing=""1 "" cellpadding=""1 "">" & vbNewline
if strAuthType = "db" then
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTable Color & """ align=""right"" nowrap><b><font face=""" &
strDefaultFon tFace & """ size=""" & strDefaultFontS ize & """>User
Name:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTable Color & """><input type=""text"" name=""name"" value="""
& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTable Color & """ align=""right"" nowrap><b><font face=""" &
strDefaultFon tFace & """ size=""" & strDefaultFontS ize &
""">Password: </font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTable Color & """><input type=""password "" name=""password ""
value="""" size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
else
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTable Color & """ align=""right"" nowrap><b><font face=""" &
strDefaultFon tFace & """ size=""" & strDefaultFontS ize & """>NT
Account:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTable Color & """><input type=""text"" name=""DBNTUser Name""
value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
end if
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTable Color & """ colspan=""2"" align=""center" "><Input
type=""Submit "" value=""Send"" id=""Submit1"" name=""Submit1" "></td>"
& vbNewline & _
" </tr>" & vbNewline & _
" </table>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" </table>" & vbNewline & _
" </form>" & vbNewline
end if
'--------------- End of Code Snippet --------------------------------

On Wed, 11 Aug 2004 17:35:18 -0400, "Paul Baker [MVP, Windows - SDK]"
<pa***@online .rochester.rr.c om> wrote:
That's an interesting question. However, it is only the dynamic parts of the
HTML that you need to worry about.

The rest of it, you can put in the ASP as is simply by closing the brackets.

eg.

<%
whatever = ...
Response.Write( whatever)
%>
<form>
blah blah blah
</form>
<%
...
%>

You can also use =expression as shorthand for writing an expression if it is
the entire code within brackets.

For example <%=whatever%> instead of <%Response.Writ e(whatever)%>

Does that help?

Paul

"TinyTim" <Ti*****@MissVi cky.com> wrote in message
news:ar***** *************** ************@4a x.com...
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
Response.Writes .

Are there any tools that will let you design the form then convert
that form to Response.Writes that you can further customize with ASP
logic? For instance: use Dreamweaver to design the form, then another
program to convert to response.writes in an aspx file.

What's the easy way of doing it? Just trying to make it less
laborious for me.

Response.Write "Thanks,"

tt


Jul 19 '05 #8
On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
<pa***@online.r ochester.rr.com > wrote:
I see that you asked both myself and Dave for tutorials on this.

I am not sure what you are getting at. You don't need a tutorial, you just
need to learn this one thing:
<%=expression% > is shorthand for <%Response.Writ e(expression)%>

So, if you find yourself typing "<%Response.Wri te(expression)% >", type
"<%=expression %>" instead. That is all there is to it. What is it you are
unsure about?

Paul

Paul,

OK, let me give you a scenerio.

The user is on my site. Types in a user-id and password and selects a
radio button item using choice 1 out of three. Because of his
selection, he needs to fill out a specialized form (all forms are
similar but not exactly the same).

So when he presses the submit button transfer is made to the server
asp page which then processes his request by: searching a database
for items to populate a dropdown list, calculate a value, place
various data fields and labels on the form, and request verification
and selection of the information.

Based on his original selection (lets say Fishing, Hiking and Hunting)
information will be displayed back to the user.

There will be non-HTML-display code in the server page to do file
handling, calculations, etc.

My thought was if I could design the complete page to be returned from
the asp code in DW, convert the entire page to response.writes then
just insert the functioning code within that page, this would be the
simplest way.

I would get the benefit of having a visual page designer combined with
the power of asp. Having to design/format a page with 15 - 20
controls properly positioned by hand seems a bit daunting to this
newbie.

Am I just making this more difficult than necessary?

Thanks for your patience,

tt
Jul 19 '05 #9
On Wed, 11 Aug 2004 15:35:42 -0700, TinyTim <Ti*****@MissVi cky.com>
wrote:
I'm looking at Snitz forum code for my examples, one of which I
included in this post. Even with your described methods, it seems
like a lot of work, having to design the page layout manually then
putting the appropriate quote marks, underscores, etc in code.


Run, don't walk, to the nearest Burger King and beg for a job. If
you're doing web programming, especially in ASP, you're going to have
to do some work.

Might want to switch to ASP.NET as an alternative.

Jeff

For example <%=whatever%> instead of <%Response.Writ e(whatever)%>

I'll be checking this method out on one of the online tutorials. Can
you point me to a specific tutorial?

Thanks,

tt

'--------------- Code Snippet Follows --------------------------------
else
Response.Write " <p><font face=""" & strDefaultFontF ace
& """ size=""" & strHeaderFontSi ze & """>You do not have permission to
change another users subscription. Only Administrators may change
another users subscriptions.</font></p>" & vbNewline

' ## This is just the form which is used to login if the
person is
' ## not logged in or does not have access to do the
moderation.
Response.Write " <form
action=""pop_s ubscription.asp ?UserCheck=Y"" method=""post""
id=""Form1"" name=""Form1""> " & vbNewline & _
" <input type=""hidden""
name=""REPLY_I D"" value=""" & ReplyID & """>" & vbNewline & _
" <input type=""hidden""
name=""TOPIC_I D"" value=""" & TopicID & """>" & vbNewline & _
" <input type=""hidden""
name=""FORUM_I D"" value=""" & ForumID & """>" & vbNewline & _
" <input type=""hidden"" name=""CAT_ID""
value=""" & CatID & """>" & vbNewline & _
" <table border=""0"" width=""75%""
cellspacing="" 0"" cellpadding=""0 "">" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgcolor=""" &
strPopUpBorder Color & """>" & vbNewline & _
" <table border=""0""
width=""100% "" cellspacing=""1 "" cellpadding=""1 "">" & vbNewline
if strAuthType = "db" then
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFont Face & """ size=""" & strDefaultFontS ize & """>User
Name:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """><input type=""text"" name=""name"" value="""
& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFont Face & """ size=""" & strDefaultFontS ize &
""">Password :</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """><input type=""password "" name=""password ""
value="""" size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
else
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFont Face & """ size=""" & strDefaultFontS ize & """>NT
Account:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """><input type=""text"" name=""DBNTUser Name""
value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
end if
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableC olor & """ colspan=""2"" align=""center" "><Input
type=""Submit" " value=""Send"" id=""Submit1"" name=""Submit1" "></td>"
& vbNewline & _
" </tr>" & vbNewline & _
" </table>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" </table>" & vbNewline & _
" </form>" & vbNewline
end if
'--------------- End of Code Snippet --------------------------------

On Wed, 11 Aug 2004 17:35:18 -0400, "Paul Baker [MVP, Windows - SDK]"
<pa***@online. rochester.rr.co m> wrote:
That's an interesting question. However, it is only the dynamic parts of the
HTML that you need to worry about.

The rest of it, you can put in the ASP as is simply by closing the brackets.

eg.

<%
whatever = ...
Response.Write( whatever)
%>
<form>
blah blah blah
</form>
<%
...
%>

You can also use =expression as shorthand for writing an expression if it is
the entire code within brackets.

For example <%=whatever%> instead of <%Response.Writ e(whatever)%>

Does that help?

Paul

"TinyTim" <Ti*****@MissVi cky.com> wrote in message
news:ar****** *************** ***********@4ax .com...
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
Response.Writes .

Are there any tools that will let you design the form then convert
that form to Response.Writes that you can further customize with ASP
logic? For instance: use Dreamweaver to design the form, then another
program to convert to response.writes in an aspx file.

What's the easy way of doing it? Just trying to make it less
laborious for me.

Response.Write "Thanks,"

tt


Jul 19 '05 #10

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

Similar topics

3
2818
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like Session("UserType") = "Sales". Then based on the Session("UserType") I use response.redirect to take the user to a specific page. The logic and response.redirect works fine on a Win2k server but when I move the page to a server running Win2003 the...
3
6278
by: Gav | last post by:
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>
3
2476
by: Brad | last post by:
I have a response filter which injects "standard" html into my pages. The filter works fine when the initial stream is small enough not to buffer...or....if I have a large unbuffered stream (i.e. I set buffer=false on a large page). Now the problem: If I turn on buffering on a large page, the page output (to the browser) is correct a few times (sometines just once, sometime 2-3 times...on the same page) then I seem to either lose data...
4
2638
by: etropic | last post by:
Im confused I want an .aspx page to have a table with my data in it. At first I wrote FillTablew(); in my Page_Load even in the Code Behind file. I had it loop the db etc. and use Response.Write of a bunch of strings. This works great as long as all I want is the results of those Response.Writes I believe what I REALLY want is to convert those Response.Writes to a str cat in the code behind, and then in the body of my .aspx page to do...
2
1067
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 Response.Writes. Are there any tools that will let you design the form then convert that form to Response.Writes that you can further customize with ASP logic? For instance: use Dreamweaver to design the form, then another program to convert to...
11
26871
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as follows: private void SubmitButton_Click (object sender, System.EventArgs e) { // Set up the response to write the print file to the client Response.Clear (); Response.AppendHeader ("Content-Disposition", "filename=WebPrint.prn");
12
7910
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug it, it works every time! I even set it to True, but did a .Flush just before the error, and the error won't happen. It only happens when response.buffer is True and no .response.flush is issued. The error is a string variable turns-up empty...
4
11432
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the XMLHTTP object. However, when the page requested through the XML object makes a <%Response.Redirect()%> call, a new session is created each time. Is this a flaw in the XMLHTTP Object? How can I force the session to remain the same after a...
4
1828
by: Ming | last post by:
Hi folks, I have a php file, it contains just a few php codes. The php codes I need to use is to construct an object, and use it several times, from html head until the last line of html code. I know I can construct the same object (I am using php5) several times, something like $object = new $class, and use several <?php $object->functionX ? ... <?php $object->functionZ ? to include php code in html code.
0
8801
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8707
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9314
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9015
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5947
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4725
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2110
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.