Hi,
Can someone explain the working principle of asp.Net below?
I have 2 separate code-block asp.Net expressions in an aspx markup, with an html content between (span element in the example below).
In the first code-block, there is "i" as an increment variable for the for loop.
Then the code-block is cut with an html content.
And another code-block expression is opened but as I see I can reach the "i" variable which was declared in the previous code-block.
So, how asp.net handles -compiles- the pieces of code-block experrions declared in the mark up? Does it check the semi-colons and generates some anonymous methods which will end up with many calls to Response.Write in the last place?
Thanks,
<p>
<%for (int i = 0; i < 30; i++)
{
Response.Write("Some text here");
%>
<span> ______________________________ </span> <%--So how this line is processed
by ASP.Net so that it is embedded
in the for loop as Response.Write
method's parameter?--%>
<%
Response.Write(i*(i+1));
Response.Write("<br />");
}%>
</p>