tutorials in 37065

Topics: blog
Mar 2, 2010 at 10:52 PM


I'm trying to use your NHaml sample from the source code of revision 37065.

I see that in UserController you have:

       public IViewData Index()


            ViewData["whom"] = "World";

            return Render();


which leads me to believe that you are replacing the variable whom in the haml with "World". However, when I look at Views/User/index.html, there is no variable "whom":



    = "Hello World"

I rewrote Views/User/index.html to include whom:



    = "Hello"



and I got the following complaint:

An error occurred when compiling the file: /user/index.haml

c:\Documents and Settings\<username>\Local Settings\Temp\urr8e_yk.0.cs(54,43) : error CS0103: The name 'whom' does not exist in the current context

0052:         textWriter.Write("      ");

0052:         textWriter.Write(Convert.ToString(whom));

0054:         textWriter.WriteLine();


Would you mind explaining where I am going wrong?

Thank you for your time,



Mar 10, 2010 at 8:22 AM



You need to write:


= ViewData["whom"]

Don't know how to fix typed views yet.