Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to register assembly in Razor view engine

How can i insert this in razor view page

<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"
    TagPrefix="asp" %>

<asp:ScriptManager runat="server" ID="MainScriptManager" />
like image 761
ebattulga Avatar asked Apr 26 '11 12:04

ebattulga


2 Answers

You can put it in the Web.Config that exists in your Views folder. It took me a while to figure this one out hope this helps.

<system.web>
  <controls>
    <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
    <add assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagPrefix="ajaxToolkit"  />
  </controls>
</system.web>
like image 109
Rich Bianco Avatar answered Sep 22 '22 13:09

Rich Bianco


You cannot. You are using ASPX markup in your example. In razor you can write:

@using System.Web.Silverlight;

btw. check this syntax quickref:

like image 28
Boris Bucha Avatar answered Sep 22 '22 13:09

Boris Bucha