I am new to .net but am familiar with classic asp. I do not understand how to use the asp:image component within a sub like I would have done in classic asp.
In Classic asp I would use a sub for demonstration purposes
<%
Sub openShadow()
%>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img src="<%=getImgRoot() %>shadow_top_left.jpg" border="0" /></td>
<td ><img src="<%=getImgRoot() %>shadow_top_mid.jpg" border="0" /></td>
<td><img src="<%=getImgRoot() %>shadow_top_left.jpg" border="0" /></td>
</tr>
</table>
<%
End Sub
call openShadow()
%>
I do not know how to do the above in .Net as a Sub so I made a Function but can not use the asp:img because it sees it as a string of text. Also I really want to double up on all my quotes.
######## BEGIN .NET SAMPLE
Public Shared Function openShadow(ByVal xWidth As Integer) As String
Dim str As String
str = "<table width=""" & xWidth & """ cellpadding=""0"" cellspacing=""0"" border=""0"">" & _
"<tr>" & _
"<td><asp:Image ImageUrl="~/images/shadow_top_left.jpg" width="9" Height="9" GenerateEmptyAlternateText="true" runat="server" /></td>" & _
"<td><asp:Image ImageUrl="~/images/shadow_top_middle.jpg" width="9" Height="9" GenerateEmptyAlternateText="true" runat="server" /></td>" & _
"<td<asp:Image ImageUrl="~/images/shadow_top_right.jpg" width="9" Height="9" GenerateEmptyAlternateText="true" runat="server" /></td>" & _
"</tr>" & _
"</table>"
Return str
str = Nothing
End Function
<%=openShadow("1002") %>
######## END .NET SAMPLE
What am I missing? In classic asp I prefer Sub Procedures over a ton of include files. Can I do the same as I did in Calssic ASP but within .Net? Should I do it this way or is there a better way?