Asp.net server tags allows you to run server side code on the client.

There are multiple reasons to not choose for running server side code on the client, like performance or loosing the option to dynamically add controls to page because there are some code tags. So the bether option is using client side code ie javascript.

But sometimes there is no other way, so here are some tags which are available:

 

Regular code: <%

<% for(int i = 0 ; i <5; i++){  %>
             <div class="div <% i %>"></div>
           <%  } %>

Displaying text: <%= 

<% for(int i = 0 ; i <5; i++){  %>
this is written on the page ( 5 times )
           <%  } %>

Displaying text(html encoded): <%: 

<% for(int i = 0 ; i <5; i++){  %>
this is written on the page ( 5 times )
           <%  } %>

Displaying data: <%# 

<%#Eval("Name")  %>

Most common error is that the databinding tag: <%# is used instead of de regular expression :<%=. The databinding expression demands that the control is databound ( meaning: the databind method is called during page load.

Another pitfall is that using code blocks on a page restricts dynamic loading of controls.

{{opmerking.Naam}}:

{{opmerking.OpmerkingText}}

            

Saving your comment....

Naam is verplicht!
Email is verplicht!
Opmerking is verplicht!