asp.old inline html in functions

V

Vikas Yadav

Hi,

I have been only working in asp.old.
Upon reading and specs, i learned that asp.net does not support just
HTML rendering subs. like:

sub showHeader()
%><table>
<tr><td>Title on <%=now()%></td></tr>
<%
end sub

I read about response.writefile but that would only output raw text and
not execute any code. I searched for any tips but failed to find.
I cannot use response.write's for everything.

Please help,

Regards,
Vikas
 
B

bruce barker

subs and function must be defined in server blocks so you need to rewrite
as:

<script runat=server>
sub showHeader()
Response.Write("<table>");
Response.Write(String.Format("<tr><td>Title on {0}</td></tr>",now());
end sub
</script>


-- bruce (sqlwork.com)


| Hi,
|
| I have been only working in asp.old.
| Upon reading and specs, i learned that asp.net does not support just
| HTML rendering subs. like:
|
| sub showHeader()
| %><table>
| <tr><td>Title on <%=now()%></td></tr>
| <%
| end sub
|
| I read about response.writefile but that would only output raw text and
| not execute any code. I searched for any tips but failed to find.
| I cannot use response.write's for everything.
|
| Please help,
|
| Regards,
| Vikas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top