• 0

How to display ASPX code tags


Question

Anybody know a way of displaying the aspx code(<% %>) without manually performing an HtmlEncode?

I want to display a block of aspx code within my aspx page.

Example.aspx:

&lt;p&gt;Check out this cool code:&lt;/p&gt;
&lt;pre&gt;
	&lt;% int x = 0; %&gt;
&lt;/pre&gt;

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Not sure if this will be much help but you should be encoding the characters anyway otherwise it won't validate, if you don't want to call the function just use

&lt;p&gt;Check out this cool code:&lt;/p&gt;
&lt;pre&gt;
	&lt;% int x = 0; %&gt;
&lt;/pre&gt;

Link to comment
Share on other sites

  • 0

I know I can explicitly do the encoding myself, but was wondering if there was a way to wrap it in some way in which I wouldn't have to do it (would make large code blocks tedious).

Doesn't appear to be possible though -- thanks.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.