c# - How ASP.net is used before Razor was introduced -


i little confused in how asp.net code written before razor introduced. can see in many pages on internet how razor used asp.net. want know how asp.net code been written without razor.

classic asp

<html> <body> <% response.write("my first asp script!") %> </body> </html>  

asp.net razor

<html> <body>      <h1>hello web pages</h1>      <p>the time @datetime.now</p> </body> </html> 

asp.net without razor??? want know how people coded in asp.net (not classic asp) before razor introduced.

classic asp written <%= %> tags, not response.write(). example:

<html> <body> <%= "my first asp script!" %> </body> </html> 

the asp.net syntax similar, <%: %> tag introduced automatically html encode values, similar razor does. example:

<html> <body>      <h1>hello web pages</h1>      <p>the time <%: datetime.now %></p> </body> </html> 

for code more complicated showing values, use <% %> tags around server code, in classic asp. example:

<html> <body>      <h1>hello web pages</h1>      <% (int = 1; <= 10; i++) { %>        <p>line <%: %></p>      <% } %> </body> </html> 

Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -