Question :
When searching the web, I saw that it is not possible to register assembly’s in the razor view engine in asp.net mvc as it was done in webforms.
<%@ Register TagPrefix="wif" Namespace="Microsoft.IdentityModel.Web.Controls" Assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
How can I do this, render a component using ASP.NET MVC?
Answer :
The way to register this in Razor is very similar. It would look like this:
@{
Register TagPrefix="wif" Namespace="Microsoft.IdentityModel.Web.Controls" Assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
}
There is also a detail of registering this in your web.config
within the Views
directory:
<configuration>
<system.web>
<pages>
<controls>
<add assembly="Microsoft.IdentityModel" namespace="Microsoft.IdentityModel.Web.Controls" tagPrefix="wif" />
</controls>
</pages>
</system.web>
</configuration>