Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated sample to use ViewData for home page message.

  • Loading branch information...
commit ff74fad63cee90285d38c7066b01cf100193016f 1 parent 47b9578
John Zablocki johnzablocki authored
12 CouchbaseAspNetSample/Constants/ViewDataConstants.cs
... ... @@ -0,0 +1,12 @@
  1 +using System;
  2 +using System.Collections.Generic;
  3 +using System.Linq;
  4 +using System.Web;
  5 +
  6 +namespace CouchbaseAspNetSample.Constants
  7 +{
  8 + public static class ViewDataConstants
  9 + {
  10 + public const string MESSAGE = "Message";
  11 + }
  12 +}
2  CouchbaseAspNetSample/Controllers/HomeController.cs
@@ -14,7 +14,7 @@ public class HomeController : Controller
14 14
15 15 public ActionResult Index()
16 16 {
17   - Session[SessionConstants.MESSAGE] = "Hello, Couchbase ASP.NET!";
  17 + ViewData[ViewDataConstants.MESSAGE] = "Hello, Couchbase ASP.NET!";
18 18
19 19 return View();
20 20 }
2  CouchbaseAspNetSample/Views/Home/Index.cshtml
@@ -2,7 +2,7 @@
2 2 ViewBag.Title = "Home Page";
3 3 }
4 4
5   -<h2>@Session[CouchbaseAspNetSample.Constants.SessionConstants.MESSAGE]</h2>
  5 +<h2>@ViewBag.Message</h2>
6 6 <p>
7 7 To learn more about Couchbase and .NET visit
8 8 <a href="http://couchbase.com/develop/net/current" title="Couchbase .NET Client Library Documentation">http://couchbase.com/develop/net/current</a>.

0 comments on commit ff74fad

Please sign in to comment.
Something went wrong with that request. Please try again.