Move html to cshtml for backbone.js in ASP.NET MVC 3

Chanmingman's Blog

If you download the tutorial for backbone.js part 1 here http://net.tutsplus.com/tutorials/javascript-ajax/build-a-contacts-manager-using-backbone-js-part-1/ you will see the UI is using html file, with html extension of course.

 

You can create a new MVC3 web application using ASP.NET MVC 3 Web Application.

 

1. Add the following code into HomeController.cs.

 

publicActionResult Contact()

{

  return View();

}

 

2. Right click the Contact() area in the HomeController and choose Add View.

Contact

 

3. You will now see Contact.cshtml in the View folder.

 

4. Paste the following code to the Contact.cshtml after the } .

 

<div>

    <metacharset=”UTF-8″/>

    <title>Backbone.js Web App</title>

  

  <linkhref=”../../Content/screen.css”rel=”stylesheet”type=”text/css”/>

 

</div>

 

<div>

    <divid=”contacts”></div>

    <scriptid=”contactTemplate”type=”text/template”>

       …

View original post 547 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s