What is Smart Navigation ?

 Posted by Chvrsri on 1/20/2012 | Category: C# Interview questions | Views: 3052 | Points: 40

When ever there is a request from a web browser which is IE 5.0 or greater Smart Navigation enhances the user feel of the page.

These are the different functions which this smart navigation performs.

1) It Persists the element focus between navigation's.

2) It also persists the scroll position when user traversing from one page to another.

3) It eliminates the flash content which was caused by navigation.

4) Most important feature is retaining the last page state in the browsers history.

This is how we can set the Smart Navigation :

We can set SmartNavigation attribute at the @ page directive in the .aspx page. So when the page is requested the dynamically generated class sets this attribute.

Note : This property is best useful when a particular web site has frequent postbacks.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Jeetmcts on: 2/8/2012 | Points: 10
Smart Navigation:- SmartNavigation seems to be a nice feature - it allows Internet Explorer to handle PostBacks in a very clever way. You don't have to worry about having a long site - it will return to the point where you have been before.

There are two way to set Smart Navigation-
1. Page.SmartNavigation=True in Page.aspx.cs
2. Through JavaScript-

<script language = "javascript">
function SetScrollPosition()
var intY = document.body.scrollTop;
document.cookie = "yPos=!~" + intY + "~!";
window.onscroll = SetScrollPosition;

Login to post response