Warning: Undefined array key "id" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "std" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "id" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "std" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "id" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "std" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "id" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "std" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "id" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "std" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "id" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "std" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "id" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "std" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "id" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "std" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "id" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Undefined array key "std" in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248

Warning: Array to string conversion in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\functions.php on line 248
| Gold Estate | Using Mustache (Nustache) with traditional ASP.NET (non MVC) | Gold Estate
Posted on 28th March 2013One Response
Using Mustache (Nustache) with traditional ASP.NET (non MVC)
  1. Download Nustache
  2. Extract zip file and open solution file.
  3. If you don’t have MVC3 installed you will get a warning that Visual Studio cannot open the project
  4. Click OK and continue
  5. Nustache.Mvc3 project will be grayed out. Right click the solution in Solution Explorer window and add new ASP .NET Application. I named it NustacheWebApplication. This will create Default.aspx page.
  6. Add new “Template” folder to the solution.
  7. Copy Index.mustache file from \ Nustache-master\Nustache.Mvc3.Example\Views\Home to the new Template folder.
  8. Add reference to the Nustache.Core project.
  9. Open Default.aspx page and add Literal control;

    <asp:LiteralID=”LiteralText“ runat=”server”></asp:Literal>

  10. Open Default.aspx.cs file and add using statements:

    using Nustache.Core;

  11. Then the following code to the Page_Load method:

    protected void Page_Load(object sender, EventArgs e)

    {

    var dataObject = new

    {

    DoModelPropertiesWork = “Model properties work!“,

    DoesHtmlEncodingWork = “<em>Should this be encoded?</em>”,

    DoesInternationalCharacterEncodingWork = “Iñtërnâtiônàlizætiøn“,

    DoesRussianCharacterEncodingWork = “Привет,как дела“

    };

    var html = Nustache.Core.Render.FileToString(

    Server.MapPath(@”~\Temlates\Index.mustache“),

    dataObject

    );

    LiteralText.Text = html;

    }

  12. You may need to unload Nustache.Mvc3 project from the solution if you don’t have MVC 3 installed before you run the application.
Comments

Fatal error: Uncaught TypeError: Unsupported operand types: string - int in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\comments.php:20 Stack trace: #0 H:\root\home\idenys-001\www\gold-estate\wp-includes\comment-template.php(1554): require() #1 H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\single.php(28): comments_template() #2 H:\root\home\idenys-001\www\gold-estate\wp-includes\template-loader.php(113): include('...') #3 H:\root\home\idenys-001\www\gold-estate\wp-blog-header.php(19): require_once('...') #4 H:\root\home\idenys-001\www\gold-estate\index.php(17): require('...') #5 {main} thrown in H:\root\home\idenys-001\www\gold-estate\wp-content\themes\technical-speech\comments.php on line 20