1

Is there any way to render ASP.net MVC controls or code directly within a XSLT/XSL transform file under the .NET Framework? If so can you provide me with a sample or link?

2 Answers 2

3

I'm reading a great ASP.NET MVC book by Apress: http://www.amazon.com/Pro-ASP-NET-Framework-Steven-Sanderson/dp/1430210079

In Chapter 10, there is a section called "Implementing a Custom View Engine", which shows you step by step how to implement an XSLT view engine. Its actually pretty simple (wish I could post it, but don't want to violate copyright).

I highly recommend this book to anyone (I bought and downloaded the e-book on their web site), the author really explains things well. ... OTOH, I recommend you avoid those red books with the authors' mug shots on them... unless you like books that consist mainly of screen shots and code dumps, with little effort on explaining concepts clearly.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you sir, my co-worker has this book and I shall give this chapter a read :).
1

Although this is possible (use the same strategy as you would with html, but harass VS frequently to make it work, and use raw text outputs for anything that XSLT is too stubborn to touch), this is almost definitely not what you actually want to do. Even if you already have XSLT for generating html documents, this strikes me as a bad idea. Instead, you should try searching for "Asp.Net Data Binding XML." You'll find results like this, which will probably give you considerably better and more maintainable results.

1 Comment

Yeah, I would avoid it too in a real project anyway... I am just interested in seeing in how this is implemented. Currently I am just passing in param's via asp.net and it works fine. thanks though

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.