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!

Synax question for HTML-spanning Subs

Status
Not open for further replies.

xStrongTowerx

Programmer
Apr 7, 2003
11
US
Hi,

I'm migrating to ASP.NET from ASP 3 and I have a question about syntax. Apparently, all code in ASP.NET occurs between <script>...</script> tags rather than using <%...%>.

So my question is, is it still possible to have a subroutine that spans HTML like this:

<script language=&quot;VB&quot; runat=&quot;server&quot;>
Sub [aSubName]
If [Condition] then
</script>

<div>Some html here.</div>

<script language=&quot;VB&quot; runat=&quot;server&quot;>
End if
End Sub
</script>

I know you're supposed to say Response.Write(&quot;<div>Some html here.</div>&quot;), however, that won't work with really long blocks of HTML code, and it doesn't work with server-side includes, either.

Thanks for your input,

xSTx
 
Question:

If I instead used the FSO to include files, would it be able to process aspx files and run the scripts, or only to output html to the browser?

i.e. (this is VBScript and would have to be updated to VB.NET)

if request(&quot;param&quot;)= 2 then
filespec = &quot;2.aspx&quot;
else
filespec = &quot;1.aspx&quot;
end if
filespec = server.mapPath(filespec)
scr = &quot;scripting.fileSystemObject&quot;
set fs = server.createobject(scr)
set f = fs.openTextFile(filespec)
content = f.readall
set f = nothing
set fs = nothing
response.write(content)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top