fbpx

Request a Call back


captcha

.NET Training – Learn How to Create Breadcrumbs in ASP.NET

In the .NET training course, you would be provided with practical programming experience of how to develop and customize web pages and website using .NET. One of the things that you may get to learn in a .NET course is creating the breadcrumbs. If not, you can still create them for yourselves by referring the following instructions given below to add up breadcrumbs for easy navigation in your website.

The navigation menu appearing at the top of the web page and that looks something like the below code is called a breadcrumb.

Home > Training > Dot Net Training

This method of navigation is named as breadcrumb as this is just similar to the case of a little girl in a story who drops bread crumbs to find the way back to home while going into the woods. The name of each web page displayed in a hierarchy guiding the user from the home page to the innermost page and again back from inner page to the home page is just similar to the situation of the story.

Bread crumbs are valuable features guiding the users about the path to reach out the home page from the current inner page presently where they are in and vice versa. Hence, navigation in a website becomes so much easy with bread crumbs displayed at the top of each page in a website. Apart from home page and the current page, a bread crumb will also include the names of all the other pages that come across while navigating from home to the innermost page.

For example, as you can see in the above bread crumbs example, the word “Training” indicates the page called “Training” from which the user can enter into the innermost or current page “Dot Net Training”. Training is an intermediate page between the home and the current “Dot Net Training” page and hence, gets displayed in the breadcrumbs hierarchy as well. Thus, using bread crumbs a user can very well scroll from the home page to the current page of the website while having an access to even the intermediate web pages too.

Thus, explained in short, bread crumbs allow the user to view his/her current location in the website while providing facility to navigate back and forth in it.

Let us now see the actual implementation of bread crumbs in a website built on .NET platform, however, which can be best, learnt and practiced under the guidance of experts through .NET training.

Let us suppose that there is a hierarchy of files and folders as in the below image

To display breadcrumbs in every page, we initially have to create the Web.sitemap file that reflects this hierarchy in its code.

<?xml version=”1.0″ encoding=”utf-8″ ?>

<siteMap xmlns=”http://schemas.microsoft.com/AspNet/SiteMap-File-1.0″ >

<siteMapNode url=”~/Default.aspx” title=”Home” description=”Home Page”>

<siteMapNode url=”~/Training.aspx” title=”Training” description=”Training Page”>

<siteMapNode url=”~/Training/DotNetTraining.aspx” title=”Dot Net Training” />

<siteMapNode url=”~/Training/JavaTraining.aspx ” title=”Java Training” />

<siteMapNode url=”~/Training/IphoneTraining.aspx” title=”iPhone Training” />

</siteMapNode>

<siteMapNode url=”~/Outsourcing/Default.aspx” title=”Outsourcing” >

<siteMapNode url=”~/Outsourcing/WebDevelopment.aspx” title=”Web Development”/>

<siteMapNode url=”~/Outsourcing/WebDesign.aspx” title=”Web Design” />

</siteMapNode>

</siteMapNode>

</siteMap>

 

Next thing is to get the breadcrumbs displayed on the webpage. For this you can either place the following code in each and every nodal page of the website or use the user navigation control supported by ASP.NET, the “SiteMapPath” control in a simpler way. Placing this control or code in Master Page of ASP.NET website, one can make the breadcrumbs display on the pages of the website.

 <div>

<asp:SiteMapPath ID=”SiteMapPath1″ runat=”server”>

Various kinds of templates are available for the SiteMapPath control.

You can use these templates to customize the appearance of the breadcrumbs displayed here.

</asp:SiteMapPath>
</div>

Creating breadcrumbs can make a website user-friendly by allowing the user to easily navigate between the pages. Breadcrumbs are easy to create and can be learnt to implement in actual .NET based websites through .NET training under the guidance of experts. Those looking to join .NET course to learn such innovative techniques and concepts of fully functional web sites, can join us at Tops Technologies.

Tops is a leading IT training institute in India offering the top .NET training courses to the freshers and students looking to improve their programming skills for better job opportunities.

Leave a Reply

Your email address will not be published.

Leave a Reply

Your email address will not be published. Required fields are marked *

Need Answers

Now???

Our Counsellors can Answer Any Queries.

 Just Request a Call

Thank you

Calling you Soon