Reputation: 19117
Total noob question here, but not finding the answer via search.
What is the method equivalant of <%= expression %>?
I'm looking to replace this:
<%
foreach (var intem in IE) {
%>
<%= Ajax.ActionLink(item,...) %>
<% } %>
with:
<%
foreach (var intem in IE) {
SomeOutputCall(Ajax.ActionLink(item,...));
}
%>
Upvotes: 1
Views: 173
Reputation: 25073
<%=var%>
was and is simply shorthand for Response.Write(var)
. Under the hood they're equivalent.
Upvotes: 0
Reputation: 904
I often use the equivalent of the following:
<%
foreach (var intem in IE) {
HttpContext.Current.Response.Write(Ajax.ActionLink(item,...));
}
%>
or you could just use "Response.Write" like SLaks answer to make it easier to follow.
Upvotes: 0
Reputation: 8674
It was response Response.Write("...") in asp, and it looks to the be he same in asp.net.
Upvotes: 0