Click here to Skip to main content
15,887,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everyone,

I started a project to leran mvc structure. I want to add a login panel first. Whatever, the problem is; I wamt to use Bootstrap.
I searched and used Package MAnager Console.

First I created an empty ASP.NET MVC 4 project
Second I used Package Manager Console and typed;
install-package twitter.bootstrap.mvc4 (completed succesfully)
install-package twitter.bootstrap.mvc4.sample(completed succesfully)
After those installiation I have seen a readme.txt

When I run the project I am getting NullReferenceException: Object reference not set to an instance of an object.

C#
public static object GetId(this object model)
   {
       return model.GetType().GetProperty(model.IdentifierPropertyName()).GetValue(model,new object[0]);
   }


I have searched but couldn't find any solution. Could you help me ?

Solved above problem. We need to add HomeController (default controller) and an Index View for the default controller.

The big problem; bootstrap does not work. Namely, there is no stil or any other thing. How could I activate bootstrap ?
Posted
Updated 28-Sep-13 2:27am
v2

1 solution

I have completed same steps which you have mentioned.But no run time errors.It's working.
So try again with new project on new place.Good luck.

Quote:
First I created an empty ASP.NET MVC 4 project
Second I used Package Manager Console and typed;
install-package twitter.bootstrap.mvc4 (completed succesfully)
install-package twitter.bootstrap.mvc4.sample(completed succesfully)
After those installiation I have seen a readme.txt
 
Share this answer
 
Comments
FoxRoot 30-Sep-13 9:30am    
I imported bootstrap folder (http://getbootstrap.com/getting-started/ downloaded from here) into my project solution. I referenced necessary css and js files. Now it works.
So I will accept your solution and also my comment will help the users that couldnt solve the problem by your way.
Have a nice day.
Emre.
Sampath Lokuge 30-Sep-13 9:58am    
My Pleasure :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900