Using the new AspNet SyntaxFilter

Topics: User Forum
Jan 13, 2010 at 4:15 PM

Hi there,

I just downloaded and installed the new release to try out the new AspNet language syntax filter. I updated the Help File Builder files and downloaded the latest XSLT patches. I then used the following in my conceptual content:

<code lang="AspNet">
  &lt;asp:FileUpload ID="FileUpload1" runat="server" /&gt;
</code>

Also, in my XML comments I tried this:
/// <example>
/// <code lang="AspNet">
/// &lt;asp:Label ID="Label1" runat="server" Text="&lt;%$ Code:GenerateLabelText()%&gt;"&gt;&lt;/asp:Label&gt;
/// </code>
In both cases, I don't get an ASP.NET header and no color coding applied to the example. Am I doing something wrong? Something else I need to do to make this work?
Thanks in advance.
Imar
Coordinator
Jan 13, 2010 at 4:31 PM

The syntax filter has nothing to do with colorizing code.  It generates a syntax section that shows how the member is declared like the C#, VB.NET, and C++ syntax sections in each API topic by default.  To colorize ASP.NET code, use "htm", "html", or "xml" as the language attribute value.  Either way, the syntax generator nor the code colorizer will add any extra ASP.NET header items to the generated code.

Eric

 

Jan 13, 2010 at 4:34 PM

Hi Eric,

Many thanks for the quick answer. Makes perfect sense now; completely misunderstood its purpose.... ;-)

So is there any other way to influence the header above the code snippet? Currently it displays XML when we use lang="xml" (which is what we've been using up until now).

Thanks,

Imar

Coordinator
Jan 13, 2010 at 8:12 PM

You can add a title attribute to override the default title which just displays the language.  See the Code Block Component help topic for a list of all attributes and how they are used.

Eric

 

Jan 13, 2010 at 8:22 PM

Excellent, exactly what I was looking for. Again, many thanks for your quick replies. I really like SHFB, and your support makes it even better.

Cheers,

Imar