Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert <%value%> within <% nnnnn %> statement

Status
Not open for further replies.

Webflex

Technical User
Apr 20, 2001
101
GB
Hi

how do I insert

<%value%>

in a whole string of code that is started and ended with

<%
code
code
code
%>

already

TIA
 
The example below shows how if the value is in a variable, such as sColor or iCount, or a constant such as numeric (1 in example) or text string (&quot;red&quot; in example)

<% sColor %>
<% iCount %>

<%
If sColor = &quot;red&quot; Then
do this
Else
If iCount = 1 Then
do that
End If
End If
%>

Is that what you're asking?





 
Not quite, the problem is - the code below requires the insertion of this

Code:
&SERVERLB=<%=SERVERLB%>

in to this below at point BBB

Code:
<%
	For i = 1 to numFolders
		theNextFolder = appEnumerator.nextFolder(currentFolder)

		If 1 = i Mod numCols Then
			Response.Write vbCrLf & &quot;<tr>&quot;
		End If
	Response.Write vbCrLf & &quot;<td align=left valign=top width='&quot; & percentCols & &quot;%'>&quot;
    	Response.Write &quot;<font size=-1><b><a href=&quot; & Chr(34) & &quot;applist.asp?&quot; & app.urlEncode(currentFolder) & Chr(92) & app.urlEncode(theNextFolder) & Chr(34) & &quot;>&quot; & vbCrLf
	Response.Write &quot;<IMG src='nfusemedia/folder.gif' border=0 align=left hspace=3>&quot; & vbCrLf
    	Response.Write theNextFolder & vbCrLf
	Response.Write &quot;</b></font></td>&quot; & vbCrLf
		If 0 = i Mod numCols Then
			Response.Write &quot;</tr>&quot; & vbCrLf
		End If
	Next

	For j = (numFolders + 1) to (numTotal)
		Set app = appEnumerator.nextApp(currentFolder)
		If 1 = j Mod numCols Then
			Response.Write vbCrLf & &quot;<tr>&quot;
		End If

		Response.Write vbCrLf & &quot;<td align=left valign=top width='&quot; & percentCols & &quot;%'>&quot;
		Response.Write &quot;<font size=2 face='Arial,Helvetica,sans-serif'><b><a href=&quot; & Chr(34) & &quot;launch.asp?&quot; & &quot;NFuse_Application=&quot; & app.getNameUrlEncoded &
BBB
Code:
 &quot;&MIMEExtension=.ica&quot; & Chr(34) & &quot; target='hiddenwindow'>&quot; 
    	Response.Write &quot;<IMG SRC='&quot; & app.getIconFileUrlEncoded & &quot;' border=0 alt=&quot; & Chr(34) & app.getFriendlyName & Chr(34) & &quot; align=left>&quot; & vbCrLf
		Response.Write app.getFriendlyName & &quot;<br>&quot; & vbCrLf
		Response.Write &quot;</a></b></font>&quot; & vbCrLf
		Response.Write &quot;</td>&quot; & vbCrLf

	If 0 = j Mod numCols Then
		Response.Write &quot;</tr>&quot; & vbCrLf
	End If
    Next
%>

that already has the <% %> tags bounding it, if I add as given then it will not work!!

TIA
 
Response.Write &quot;<font size=2 face='Arial,Helvetica,sans-serif'><b><a href=&quot; & Chr(34) & &quot;launch.asp?&quot; & &quot;NFuse_Application=&quot; & app.getNameUrlEncoded&SERVERLB=&quot; & SERVERLB & &quot;&MIMEExtension=.ica&quot; & Chr(34) & &quot; target='hiddenwindow'>&quot;
 
Ta

Causes this

Code:
Microsoft VBScript compilation error '800a0401' 

Expected end of statement 

/nfuse/asp/newapplist.asp, line 169 

Response.Write &quot;<font size=2 face='Arial,Helvetica,sans-serif'><b><a href=&quot; & Chr(34) & &quot;launch.asp?&quot; & &quot;NFuse_Application=&quot; & app.getNameUrlEncoded&SERVERLB=&quot; & SERVERLB & &quot;&MIMEExtension=.ica&quot; & Chr(34) & &quot; target='hiddenwindow'>&quot;
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^

^ pointing at the &quot; after .ica
 
Tried this

Code:
		Response.Write &quot;<font size=2 face='Arial,Helvetica,sans-serif'><b><a href=&quot; & Chr(34) & &quot;launch.asp?&quot; & &quot;NFuse_Application=&quot; & app.getNameUrlEncoded&SERVERLB=&quot; & SERVERLB &
&quot;&quot;
Code:
&MIMEExtension=.ica&quot; & Chr(34) & &quot; target='hiddenwindow'>&quot;

which sort of works, does this look correct ?

 
i forgot the '& &quot;' after the previous variable....

Response.Write &quot;<font size=2 face='Arial,Helvetica,sans-serif'><b><a href=&quot; & Chr(34) & &quot;launch.asp?&quot; & &quot;NFuse_Application=&quot; & app.getNameUrlEncoded & &quot;&SERVERLB=&quot; & SERVERLB & &quot;&MIMEExtension=.ica&quot; & Chr(34) & &quot; target='hiddenwindow'>&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top