Server Side Environment in ASP.NET

In this blog, I’m explaining about server side environment in .Net


The server side environment that runs a scripting language is a web server. A user’s request is fulfilled by running a script directly on the web server to generate dynamic HTML pages. This HTML is then sent to the client browser. It is usually used to provide interactive web sites that interface to databases or other data stores on the server.

A server-side script is a series of instructions used to sequentially issue commands to the Web server. These scripts are differentiated from text and HTML by delimiters. A delimiter is a character or sequence of characters that marks the beginning or end of a unit. ASP.NET  uses the delimiters <% and %> to enclose script commands. Within the delimiters, you can include any command that is valid for the scripting language you are using.

Using code

<%@ %>:  Text template Directive

<%= %> and <% %> Embedded code Blocks

<:>: HTML Encoding Output

<#>:Data binding Expression


<%--   --%>:Server side Comments

@:Razor code instruction

@*  *@:Comment in Razor


Data binding Expression

<%# Bind("id") %>

Embedded Code Blocks  


var role = Session["RoleName"] != null ? Session["RoleName"].ToString() : "";


Leave Comment