Output two viewbag values in one embedded code block

black_cyber89

New Member
I have the following code for my HomeController.cs\[code\]ViewBag.Test = "hi there";ViewBag.Message = "sausages";\[/code\]and then I return View();In my aspx page, I reference ViewBag.Message like this:\[code\]<h2><%:ViewBag.Message %></h2>\[/code\]How do I go about doing something like ( I know it makes no sense to but... ) \[code\]<% ViewBag.Message; ViewBag.Test %>\[/code\]?In order to output: sausages hi there
 
Back
Top