Skip to main content

Posts

Showing posts from February, 2020

ASP.NET MVC HTML Helpers

ASP.NET MVC HTML Helpers What are Html Helpers? An HTML Helper is simply a method that returns a HTML string. The string can represent any type of content that you want. For example, you can use HTML Helpers to render standard HTML tags like HTML <input>, <button> and <img> tags etc.                   Helper class can create HTML controls programmatically. HTML Helpers are used in View to render HTML content. It is not mandatory to use HTML Helper classes for building an ASP.NET MVC application, but HTML Helpers helps in the rapid development of a view. You can also create your own HTML Helpers to render more complex content such as a menu strip or an HTML table for displaying database data. Categories of HTML Helpers? 1.      Built-in HTML Helpers 2.      Inline HTML Helpers 3.      Custom HTML Help...

Setup & Deploy Web Application on IIS

Setup & Deploy Web Application on IIS Explained What is IIS? IIS or Internet Information Server is the server used to host .Net web applications. IIS is normally installed on a Window Server. For users to access a website, it is required that the website is hosted on some sort of web server. There are different web servers available for different technologies. In .Net, the web server available is called  Internet Information Services or IIS . Once the web application is developed, it is then deployed on an IIS Server. This web application can then be accessed by the end users. How to install or Configure IIS in Windows OS Go to Control Panel as shown below Click on Programs and Feature as shown below Click on Turn Windows Features on or off on top left corner of the window as shown below Expand the Internet Information Services folder as show below Expand the World Wide Web Services as shown below Expand the Application De...

Role-Based Menu in ASP.NET MVC

Role-Based Menu in ASP.NET MVC with Example In this article, we are going to learn how to create a role-based menu in ASP.NET MVC. This menu system will show menu items based on the role of the login user. For instance, Admin user will be able to create more role, assign a user to a role and activities that only admin of the site can perform. This will enable the system to control who see what of the system. We are using our application from the previous article Role-BasedAuthorization in ASP.NET MVC Open the project Csharpnaija_Security in Visual Studio to continue from role-based authorization. Since we have learnt how to provide role-based authorization to our user, role-based menu will be just a question of changing or adding some razor code to our layout view (Page). Expand the Views folder of our project in solution explorer, then expand the Shared folder to see the layout view as shown below Now double click on the Layout.cshtml to see the html and razo...