c# - Having Multiple Outputs for a single action -


Just a question that requires quick answers,

I have a verb, say ,

  BlogPostController.List ();  

Lists all the posts in a fictional blog engine.

I want both an HTML output of this data and an XML output of this data.

Preferably I want to be able to fully understand the URLs by them, for example:

  http://MyHypotheticalBlogEngine.com/BlogPosts/List http: //MyHypotheticalBlogEngine.com/BlogPosts/List.xml  

And then when I call View () in my action method it depends on the .aspx view or .xml view or No.

Is there something like this (I can not get information about this, but I can not really search for good keywords about it) or it is "searching for another way or You can find your own way of "job"?

Cheers

You must specify an input parameter which may be the default view Is empty but for other different forms You need to specify which you may want to support. In case of RSS reader you can support RSS, Atom, XML etc. Choose Default and then add your URL to other format types.

< Pre> domain.com/blogs/list/ Domain.com/blogs/list/xml domain.com/blogs/list/atom

etc.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -