Define inline code or inline expressions performed when the page is present. There are two styles: intraline code and inline format. The independent code block or control flow block can be defined using the inline code.
<% inline code%>
The inline expression is used as call TabINDEX = "0" keywords = "frfsystemwebhttpresponseclasswritetopic"> httpresponse.write method shortcuts.
<% = inline expression%>
Note
If you try to include the character sequence%>, a compilation error occurs if you contained the cascade in the code rendering block. This sequence can only be used to end the code presence block. For example, the following code snippet will result in an error:
[C #]
<% @ Page language = "c #"%>
<%
Response.write ("%>");
%>
[Visual Basic]
<% @ page language = "vb"%>
<%
Response.write ("%>)
%>
To resolve this problem, you can build a string containing the character sequence, as shown in the following example.
[C #]
<% @ Page language = "c #"%>
<%
String s = "%" ">";
Response.write (s);
%>
[Visual Basic]
<% @ page language = "vb"%>
<%
DIM S As String
s = "%" & ">"
Response.write (s)
%>
Note Unlike Active Server Pages (ASP), in ASP.NET, declare code presentation blocks (in
<%
The function or subroutine between%> tags is invalid.
Example
The following example illustrates how the same HTML text is displayed in a variety of different font size using a rendering block.
[C #]
<% for (int i = 0; i <10; i ) {%>
> Hello World! font>
<% Next%>
See
TabINDEX = "0" keywords = "cpconintroductionTowebforms"> Introduction Web Form Page | Web Form Syntax