Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated sample to use ViewData for home page message.

  • Loading branch information...
commit ff74fad63cee90285d38c7066b01cf100193016f 1 parent 47b9578
@johnzablocki johnzablocki authored
View
12 CouchbaseAspNetSample/Constants/ViewDataConstants.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace CouchbaseAspNetSample.Constants
+{
+ public static class ViewDataConstants
+ {
+ public const string MESSAGE = "Message";
+ }
+}
View
2  CouchbaseAspNetSample/Controllers/HomeController.cs
@@ -14,7 +14,7 @@ public class HomeController : Controller
public ActionResult Index()
{
- Session[SessionConstants.MESSAGE] = "Hello, Couchbase ASP.NET!";
+ ViewData[ViewDataConstants.MESSAGE] = "Hello, Couchbase ASP.NET!";
return View();
}
View
2  CouchbaseAspNetSample/Views/Home/Index.cshtml
@@ -2,7 +2,7 @@
ViewBag.Title = "Home Page";
}
-<h2>@Session[CouchbaseAspNetSample.Constants.SessionConstants.MESSAGE]</h2>
+<h2>@ViewBag.Message</h2>
<p>
To learn more about Couchbase and .NET visit
<a href="http://couchbase.com/develop/net/current" title="Couchbase .NET Client Library Documentation">http://couchbase.com/develop/net/current</a>.
Please sign in to comment.
Something went wrong with that request. Please try again.