By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,165 Members | 1,908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,165 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
13 Replies


P: n/a
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.Write(whatever)%>

Does that help?

Paul

"TinyTim" <Ti*****@MissVicky.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 #2

P: n/a
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.RoleOptionList%></select>
<textarea name="Comments"><%=Page.Comments%></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

P: n/a
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.Write(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=""" & strDefaultFontFace
& """ size=""" & strHeaderFontSize & """>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.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=""" &
strPopUpBorderColor & """>" & vbNewline & _
" <table border=""0""
width=""100%"" cellspacing=""1"" cellpadding=""1"">" & vbNewline
if strAuthType = "db" then
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize & """>User
Name:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""text"" name=""name"" value="""
& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize &
""">Password:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""password"" name=""password""
value="""" size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
else
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize & """>NT
Account:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""text"" name=""DBNTUserName""
value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
end if
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ 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.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.Write(whatever)%>

Does that help?

Paul

"TinyTim" <Ti*****@MissVicky.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

P: n/a
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**********@spammotel.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.RoleOptionList%></select>
<textarea name="Comments"><%=Page.Comments%></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

P: n/a
On Wed, 11 Aug 2004 15:35:42 -0700, TinyTim <Ti*****@MissVicky.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.Write(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.GetRows()" method - like in the clsDBErrorChecker.asp File
it adds 2 custom properties to the Jscript Array called
"numberOfRows" &
"numberOfColumns" 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.length >0 before use.
*/

function VB_JSarray(aVBArrayFromDBCheck_OpenIntoArrayMethod ,
displayDebugInfo) {
if (typeof aVBArrayFromDBCheck_OpenIntoArrayMethod !=
'string') {
vbRowsArray = new
VBArray(aVBArrayFromDBCheck_OpenIntoArrayMethod);
var numberOfColumns = vbRowsArray.ubound(1) + 1;
var numberOfRows = vbRowsArray.ubound(2) + 1;
var rowsArray = vbRowsArray.toArray();
rowsArray.rows = numberOfRows;
rowsArray.cols = numberOfColumns;
if (displayDebugInfo) {
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.QueryString('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.length < 1) {
sOutput += '<span style="background:#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.length; i++) {
sText = String(arguments[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.toUpperCase().substring(0, 6) == '{HEAD}') {
sText =
sText.toUpperCase();
}
// 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.substring(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:#F90; 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(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;">EMPTY</span>}');

var sText = '<span
style="background:#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.length-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="background:#600; color:#C00; font: bold 12px Comic Sans MS,
Verdana;">&nbsp;{&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=sNewHead.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.Redirect or Server.Transfer depending on ASP version
function redirect(sDestination) {
// use expensive round-trip redirect always
// Server.Transfer caused problems
Response.Redirect (sDestination);
}
//************************************************** *****************************
// to return the html code for a transparent image of iWidth, iHeight
function pixelImage(iWidth, 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(bCentered) {
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 closeWindowAndOpener(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.close();return false;">Close
Window</a>&nbsp;]</span>';
if (bCentered) {
sText += '</div>';
}
return sText;
}

//************************************************** *****************************
function userErrorMessage(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:#C00;
font-weight: bold;">&nbsp;ERROR:&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(sString, 10) || iDefault || 0;
sString = (''+sString).toLowerCase();

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=""" & strDefaultFontFace
& """ size=""" & strHeaderFontSize & """>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.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=""" &
strPopUpBorderColor & """>" & vbNewline & _
" <table border=""0""
width=""100%"" cellspacing=""1"" cellpadding=""1"">" & vbNewline
if strAuthType = "db" then
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize & """>User
Name:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""text"" name=""name"" value="""
& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize &
""">Password:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""password"" name=""password""
value="""" size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
else
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize & """>NT
Account:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""text"" name=""DBNTUserName""
value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
end if
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ 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.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.Write(whatever)%>

Does that help?

Paul

"TinyTim" <Ti*****@MissVicky.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

P: n/a
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.Write(expression)%>

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

Paul

"TinyTim" <Ti*****@MissVicky.com> wrote in message
news:jr********************************@4ax.com...
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**********@spammotel.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.RoleOptionList%></select>
<textarea name="Comments"><%=Page.Comments%></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

P: n/a
Thanks,

tt

On Thu, 12 Aug 2004 11:01:02 +0100, Harag
<ha**********************@softhome.net> wrote:
On Wed, 11 Aug 2004 15:35:42 -0700, TinyTim <Ti*****@MissVicky.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.Write(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.GetRows()" method - like in the clsDBErrorChecker.asp File
it adds 2 custom properties to the Jscript Array called
"numberOfRows" &
"numberOfColumns" 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.length >0 before use.
*/

function VB_JSarray(aVBArrayFromDBCheck_OpenIntoArrayMethod ,
displayDebugInfo) {
if (typeof aVBArrayFromDBCheck_OpenIntoArrayMethod !=
'string') {
vbRowsArray = new
VBArray(aVBArrayFromDBCheck_OpenIntoArrayMethod );
var numberOfColumns = vbRowsArray.ubound(1) + 1;
var numberOfRows = vbRowsArray.ubound(2) + 1;
var rowsArray = vbRowsArray.toArray();
rowsArray.rows = numberOfRows;
rowsArray.cols = numberOfColumns;
if (displayDebugInfo) {
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.QueryString('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.length < 1) {
sOutput += '<span style="background:#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.length; i++) {
sText = String(arguments[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.toUpperCase().substring(0, 6) == '{HEAD}') {
sText =
sText.toUpperCase();
}
// 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.substring(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:#F90; 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(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;">EMPTY</span>}');

var sText = '<span
style="background:#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.length-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="background:#600; color:#C00; font: bold 12px Comic Sans MS,
Verdana;">&nbsp;{&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=sNewHead.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.Redirect or Server.Transfer depending on ASP version
function redirect(sDestination) {
// use expensive round-trip redirect always
// Server.Transfer caused problems
Response.Redirect (sDestination);
}
//************************************************** *****************************
// to return the html code for a transparent image of iWidth, iHeight
function pixelImage(iWidth, 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(bCentered) {
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 closeWindowAndOpener(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.close();return false;">Close
Window</a>&nbsp;]</span>';
if (bCentered) {
sText += '</div>';
}
return sText;
}

//************************************************** *****************************
function userErrorMessage(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:#C00;
font-weight: bold;">&nbsp;ERROR:&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(sString, 10) || iDefault || 0;
sString = (''+sString).toLowerCase();

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=""" & strDefaultFontFace
& """ size=""" & strHeaderFontSize & """>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.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=""" &
strPopUpBorderColor & """>" & vbNewline & _
" <table border=""0""
width=""100%"" cellspacing=""1"" cellpadding=""1"">" & vbNewline
if strAuthType = "db" then
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize & """>User
Name:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""text"" name=""name"" value="""
& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize &
""">Password:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""password"" name=""password""
value="""" size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
else
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize & """>NT
Account:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""text"" name=""DBNTUserName""
value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
end if
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ 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.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.Write(whatever)%>

Does that help?

Paul

"TinyTim" <Ti*****@MissVicky.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 #8

P: n/a
On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
<pa***@online.rochester.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.Write(expression)%>

So, if you find yourself typing "<%Response.Write(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

P: n/a
On Wed, 11 Aug 2004 15:35:42 -0700, TinyTim <Ti*****@MissVicky.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.Write(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=""" & strDefaultFontFace
& """ size=""" & strHeaderFontSize & """>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.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=""" &
strPopUpBorderColor & """>" & vbNewline & _
" <table border=""0""
width=""100%"" cellspacing=""1"" cellpadding=""1"">" & vbNewline
if strAuthType = "db" then
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize & """>User
Name:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""text"" name=""name"" value="""
& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize &
""">Password:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""password"" name=""password""
value="""" size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
else
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" &
strDefaultFontFace & """ size=""" & strDefaultFontSize & """>NT
Account:</font></b></td>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """><input type=""text"" name=""DBNTUserName""
value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
" </tr>" & vbNewline
end if
Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" &
strPopUpTableColor & """ 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.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.Write(whatever)%>

Does that help?

Paul

"TinyTim" <Ti*****@MissVicky.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

P: n/a
On Thu, 12 Aug 2004 16:10:20 -0700, TinyTim <Ti*****@MissVicky.com>
wrote:
On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
<pa***@online.rochester.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.Write(expression)%>

So, if you find yourself typing "<%Response.Write(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?


Many would argue your making use of DreamWeaver is what's making
things harder for you. :)

Create your page in DreamWeaver, as you want it, then insert the
relevant ASP codes. DW does databases just fine on it's own (okay,
fine for DreamWeaver users, for coders it's bloated and
inefficient...). You may not even need to write code.

Jeff
Jul 19 '05 #11

P: n/a
We use DreamWeaver. Well our company. I do not.

I use a little something called Notepad. It might save you some
complication.

Paul

"Jeff Cochran" <je*********@zina.com> wrote in message
news:41**************@msnews.microsoft.com...
On Thu, 12 Aug 2004 16:10:20 -0700, TinyTim <Ti*****@MissVicky.com>
wrote:
On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
<pa***@online.rochester.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 justneed to learn this one thing:
<%=expression%> is shorthand for <%Response.Write(expression)%>

So, if you find yourself typing "<%Response.Write(expression)%>", type
"<%=expression%>" instead. That is all there is to it. What is it you areunsure 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?


Many would argue your making use of DreamWeaver is what's making
things harder for you. :)

Create your page in DreamWeaver, as you want it, then insert the
relevant ASP codes. DW does databases just fine on it's own (okay,
fine for DreamWeaver users, for coders it's bloated and
inefficient...). You may not even need to write code.

Jeff

Jul 19 '05 #12

P: n/a
On Fri, 13 Aug 2004 10:30:09 -0400, "Paul Baker [MVP, Windows - SDK]"
<pa***@online.rochester.rr.com> wrote:
We use DreamWeaver. Well our company. I do not.

I use a little something called Notepad. It might save you some
complication.

Paul
lol, I use dreamweaver MX but I don't use any of its "Coding"
features, I use it mainly for project files, remote/testing server
syncronising(sp) uploading files to server, and the colo(u)r coding of
the code I like to do my comment lines with light green on drk green
backgrounds so I can have a line of stars /****************/ between
each function so they stand out as I scroll down. I also find it
easier to "learn" when I actually name the variables I want rather
than a load called MM_daftname etc.

IMHO

AL.

"Jeff Cochran" <je*********@zina.com> wrote in message
news:41**************@msnews.microsoft.com...
On Thu, 12 Aug 2004 16:10:20 -0700, TinyTim <Ti*****@MissVicky.com>
wrote:
>On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
><pa***@online.rochester.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, youjust >>need to learn this one thing:
>><%=expression%> is shorthand for <%Response.Write(expression)%>
>>
>>So, if you find yourself typing "<%Response.Write(expression)%>", type
>>"<%=expression%>" instead. That is all there is to it. What is it youare >>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?


Many would argue your making use of DreamWeaver is what's making
things harder for you. :)

Create your page in DreamWeaver, as you want it, then insert the
relevant ASP codes. DW does databases just fine on it's own (okay,
fine for DreamWeaver users, for coders it's bloated and
inefficient...). You may not even need to write code.

Jeff


Jul 19 '05 #13

P: n/a
I use StarTeam (was Starbase, now owned by Borland) to do the version
control on the parts of the web site I modify. That is why I don't need
DreamWeaver for that sort of thing, as you mention.

Paul

"Harag" <ha**********************@softhome.net> wrote in message
news:7n********************************@4ax.com...
On Fri, 13 Aug 2004 10:30:09 -0400, "Paul Baker [MVP, Windows - SDK]"
<pa***@online.rochester.rr.com> wrote:
We use DreamWeaver. Well our company. I do not.

I use a little something called Notepad. It might save you some
complication.

Paul

lol, I use dreamweaver MX but I don't use any of its "Coding"
features, I use it mainly for project files, remote/testing server
syncronising(sp) uploading files to server, and the colo(u)r coding of
the code I like to do my comment lines with light green on drk green
backgrounds so I can have a line of stars /****************/ between
each function so they stand out as I scroll down. I also find it
easier to "learn" when I actually name the variables I want rather
than a load called MM_daftname etc.

IMHO

AL.

"Jeff Cochran" <je*********@zina.com> wrote in message
news:41**************@msnews.microsoft.com...
On Thu, 12 Aug 2004 16:10:20 -0700, TinyTim <Ti*****@MissVicky.com>
wrote:

>On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
><pa***@online.rochester.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.Write(expression)%>
>>
>>So, if you find yourself typing "<%Response.Write(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?

Many would argue your making use of DreamWeaver is what's making
things harder for you. :)

Create your page in DreamWeaver, as you want it, then insert the
relevant ASP codes. DW does databases just fine on it's own (okay,
fine for DreamWeaver users, for coders it's bloated and
inefficient...). You may not even need to write code.

Jeff

Jul 19 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.