just a question that needs a quick answer,
I have a Action, lets say,
BlogPostController.List();
Which lists all the Posts in a hypothetical blog engine.
I want both a HTML output of this data and an XML output of this data.
Preferably I’d like to be able to address these purely by URL, for example:
http://MyHypotheticalBlogEngine.com/BlogPosts/List
http://MyHypotheticalBlogEngine.com/BlogPosts/List.xml
And then when I call View() in my Action method it’d pick either the .aspx view or the .xml view depending.
Is this something built in (I can’t seem to find info on it as it is, but I can’t think of good keywords to really search for it either) or is it a “find another way or roll your own way” jobby?
Cheers
You need to specify an input parameter that can be blank for the default view but needs to be specified to achieve the other various forms that you might want to support. In the case of an RSS reader you might support RSS, ATOM, XML, etc. Choose the default and then add to your url the other format types.
etc.