0

I would like to use the asp.net mvc actionlink and form controls in xslt code. How do I go about doing this? is this notpossible to do in xslt? I could not find a solution online.

2 Answers 2

1

It's possible. Check out these links to get you started.

http://blog.stevensanderson.com/category/xslt/

http://weblogs.asp.net/jigardesai/archive/2008/02/08/xslt-transformation-in-asp-net-mvc-framework.aspx

http://derek-says.blogspot.com/2008/05/creating-views-using-xsl-in-aspnet-mvc.html

Last but not least.... A sample on codeplex doing this. http://tpeczek.codeplex.com/releases/view/45199

EDIT: Upon further thought...

Since it seems you are wanting to use XSLT at runtime then rendering an action link or other controls using the helpers in MVC won't work. The XSLT will spit out the action link or control based on your entered transformation but the MVC engine will not execute on it to create the resultant html.

If you were doing this at design time say as part of a code generator then you could use the XSLT to create your views but you would still have to take the resultant file and use that as your view in your application.

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

1 Comment

Hmmm..i checked all links but it does not show an example of how to render MVC controls in xslt.
0

Not possible. The ASP.NET MVC HTML helpers produce strings, while XSLT produce a tree of nodes.

Comments

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.