I have the following code for my HomeController.cs
ViewBag.Test = "hi there";
ViewBag.Message = "sausages";
and then I return View();
In my aspx page, I reference ViewBag.Message like this:
<h2><%:ViewBag.Message %></h2>
How do I go about doing something like ( I know it makes no sense to but… )
<% ViewBag.Message; ViewBag.Test %>
?
In order to output: sausages hi there
You’re asking how to concatenate strings:
You may also want a space.