What is Css Font and why it is in Database Table in ASP.Net

Last Reply one year ago By AnandM

Posted one year ago

The question is to Shashikant who has answered "Database driven N-Level(Multilevel) Bootstrap(Responsive) Vertical Menu"

1. The table structure is understandable, but values cannot. For example what is CssFont and what is its value? Why it is in data table?

In html markup it is appearing in tag <i> which is italics. Is it required?

 

Nitin

Posted one year ago Modified on one year ago

Hi Nitin_Rajurka...,

CssFont is nothing but containing only the font values which are assignable to <i> tag in bootstrap with the fontawesome css.

Basically CssFont have four values which will be displayed once the menu is binded if you take a close look into screenshot provided link

Database Driven N-Level(MultiLevel) Bootstrap(Responsive) Vertical Menu

Then you will see the "DashBoard" font is visible adjacent to the "Home" Menu and "Car" font is visible adjacent to "Services" Menu like etc which are image binded with the help of classes of fontawesome.

For more info font awesome classes you can refer below link

http://fontawesome.io/

Where you will have more idea of display the fonts like "user" etc.

You can have look into table structure with data then you have idea why it is used.

SQL

CREATE TABLE [dbo].[Menus](
	[MenuId] [int] IDENTITY(1,1) NOT NULL,
	[ParentMenuId] [int] NOT NULL,
	[Title] [varchar](100) NULL,
	[Description] [varchar](100) NULL,
	[Url] [nvarchar](100) NOT NULL,
	[CssFont] [varchar](100) NULL,
 CONSTRAINT [PK_Menus] PRIMARY KEY CLUSTERED 
(
	[MenuId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Menus] ON
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (1, 0, N'Home', NULL, N'~/Home.aspx', N'fa fa-dashboard fa-lg')
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (2, 0, N'Services', N'Services Page', N'javascript:;', N'fa fa-car fa-lg')
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (3, 0, N'About', N'About Us Page', N'~/About.aspx', N'fa fa-user fa-lg')
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (4, 0, N'Contact', N'Contact Us Page', N'javascript:;', N'fa fa-users fa-lg')
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (5, 2, N'Consulting', N'Consulting Page', N'~/Consulting.aspx', NULL)
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (6, 2, N'Outsourcing', N'Outsourcing Page', N'~/Outsourcing.aspx', NULL)
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (9, 4, N'Phone', N'Phone Page', N'javascript:;', NULL)
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (10, 9, N'HomePhone', N'Home Phone Page', N'~/HomePhone.aspx', NULL)
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (12, 9, N'MobilePhone', N'Mobile Phone Page', N'javascript:;', NULL)
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (13, 12, N'Personal', N'Personal Mobile', N'~/PersonalMob.aspx', NULL)
INSERT [dbo].[Menus] ([MenuId], [ParentMenuId], [Title], [Description], [Url], [CssFont]) VALUES (14, 12, N'AddedNew', N'Added New Page', N'javascript:;', NULL)
SET IDENTITY_INSERT [dbo].[Menus] OFF