Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active January 29, 2016 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/23b246d40840d79f6a60 to your computer and use it in GitHub Desktop.
Save bjoerntx/23b246d40840d79f6a60 to your computer and use it in GitHub Desktop.
public ActionResult Index()
{
// create a new instance of the model
// fill the model from your data source here
address newAddress = new address()
{
Name = "Peter Jackson",
Street = "2332 Paul Jackson Dr"
};
// create a new XML document
XmlDocument xml = SerializeToXmlDocument(newAddress);
// fill the ViewBag and return the view
ViewBag.xmlDataSource = xml;
return View();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment