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);
Comments
Post a Comment