c# - Is it possible to dynamically add embedded code blocks to asp.net page similar to how controls are added dynamically from code? -


one can dynamically add controls asp.net page.

    label mylabel = new label();     mylabel.text = "sample label";     panel1.controls.add(mylabel);   

i want know if possible add embedded code blocks dynamically?

if code below, embedded code rendered literally.

    // use <%#page.title%> or <%=page.title%> example     literalcontrol literal = new literalcontrol("<%=page.title%>");      panel1.controls.add(literal);   

the output of above code be

<%=page.title%>

is there way make asp.net evaluate embedded code blocks added dynamically?

literalcontrol literalcontols = new literalcontrol(); literalcontols.text = page.title;  this.masterform.controls.add(literalcontols); 

enter image description here


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -