Tech Study

How do I import a namespace in Razor View Page?

In this article, I have explained 2 methods to imports namespace in MVC’s razor view page

Method 1

@using SampleNamespace;
@Imports Mynamespace;

Method 2

Find "web.config" file in "Views" sections of your current project and add following code :

  <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <add namespace="System.Web.Mvc" />
      <add namespace="Samplenamespace.customer" />
<!-- add more namespace as above-->


TaggedHow do I import a namespace in Razor View Page?

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more