locked
Is there a way to generate ASP.NET script blocks in XSL Transform RRS feed

  • Question

  • User-1834218286 posted

    This is what I'm trying to generate using XSL Transform

    <img src='<%= Class1.ImageName("arg1") %>' alt="alt text"/>

    This is what I've tried, but it just puts the markup on the page.

                    <xsl:if test='@option2=1' >
                        Todo:'&lt;%= Class1.ImageName(""arg1"") %>'
                    </xsl:if> 

    Here's what I get, but not's what expected:

    no image

    Monday, March 27, 2017 1:00 PM

All replies

  • User-707554951 posted

    Hi rod24rod.

    From your description, as far as know.

    The XslCompiledTransform class supports embedded scripts using the msxsl:script element. When the style sheet is loaded, any defined functions are compiled to Microsoftintermediate language (MSIL) by the Code Document Object Model (CodeDOM) and are executed during run time. The assembly generated from the embedded script block is separate than the assembly generated for the style sheet.

    For more information, you could refer to the following link:

    https://msdn.microsoft.com/en-us/library/wxaw5z5e(v=vs.110).aspx

    Best regards

    Cathy

    Tuesday, March 28, 2017 8:03 AM