Expressions

ASP.NET Inline Expressions


Web page by Kevin Harris of Homer IL

Please contact Kevin Harris of Homer IL concerning this web site

https://support.microsoft.com/en-us/kb/976112

  1. <% ... %> - Embedded Code Blocks. The code in the block can execute programming statements and call functions in the current page class. Used in classical ASP.

    1
    2
    3
    4
    5
    <ul>
      <% for (int i = 0; i < 10; i++) { %>
       <li> <%= i.ToString() %> </li>
      <% } %></ul>
    


    <% ... %> - Embedded Code Blocks

  2. <%= ... %> - Writes to the response stream. Same as <% Response.Write() %>

  3. <%: ... %> - Same as above, except is HTML encoded.

  4. <%@ ... %> - Directive Expression. Specifies settings that are used by the page or user control.

    1
    2
    <%@ Page Title="Login Page" Language="C#" MasterPageFile="~/Site.master"
        AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Namespace.Login" %>
    


    <%@ ... %> - Directive Expression.

  5. <%# ... %> - Data Binding Expression. Creates binding between a server control property and a data source.

    1
    2
    <a href="/documents/nyseslat/<%# Eval("Filename") %>"
       style="font-family: Helvetica; font-size: 12px;"><%# Eval("Filename").ToString() %></a>
    


    <%# ... %> - Data Binding Expression

  6. <%$ ... %> - Expression Builder. Sets values of control properties based on the information that is contained in an application's configuration resource files.

    1
     ProviderName="<%$ ConnectionStrings:My.ProviderName %>"
    


    <%$ ... %> - Expression Builder.

  7. <%-- ... %> - Server-Side Comments Blocks. Content between the opening and closing tags of the server-side comments block will not be processed on the server or rendered on the resulting page.

    1
    2
    3
    4
    5
    6
    <%-- Current Password is Required. --%>
    <asp:RequiredFieldValidator
      ID="rfCurrentPassword" runat="server"  ControlToValidate="CurrentPassword"
      CssClass="failureNotificationMedium" ErrorMessage="Current Password is required." 
      ToolTip="Current Password is required." ValidationGroup="vgChangeUserPassword">*
    </asp:RequiredFieldValidator>
    


    <%-- ... %> - Server-Side Comments Blocks

Error | ASP.NET Developer

Error

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /srv/disk9/1218369/www/kcshadow.net/aspnet/includes/common.inc:2748) in drupal_send_headers() (line 1232 of /srv/disk9/1218369/www/kcshadow.net/aspnet/includes/bootstrap.inc).
  • PDOException: SQLSTATE[42000]: Syntax error or access violation: 1142 INSERT command denied to user '1218369_b2cf'@'185.176.40.58' for table 'watchdog': INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => cron [:db_insert_placeholder_2] => Attempting to re-run cron while it is already running. [:db_insert_placeholder_3] => a:0:{} [:db_insert_placeholder_4] => 4 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://www.kcshadow.net/aspnet/?q=expressions [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 54.162.171.242 [:db_insert_placeholder_9] => 1534727987 ) in dblog_watchdog() (line 160 of /srv/disk9/1218369/www/kcshadow.net/aspnet/modules/dblog/dblog.module).
The website encountered an unexpected error. Please try again later.