Welcome Guest Log in
   The topic address is: http://callbackpage.softain.com/Help/PathHolder/PathHolder.aspx   Send to a friend
SoftAIN class library
PathHolder class
See also  Members
Collapse all  
 
The class helps to identify the current position of a user on a site, to exchange links via e-mail and support the site functionality for users with JavaScript turned off.

Namespace: SoftAIN
Assembly:CallbackPage.dll

CollapseSyntax

C#
public class PathHolder: System.Web.UI.WebControls.WebControl, IHttpModule

CollapseRemarks

Like any AJAX solution, the CallbackPage technology is based on operations with the browser’s document with the help of the JavaScript language. Links to any active element of a page usually call a specified JavaScript function. A typical link address for ASP.NET might look like this: javascript:__doPostBack('Help_Control$_ctl1$PathHolder_Control$_ctl2$MembersButton','');. Such addresses have a number of serious disadvantages. If a user turned off active scripts in his browser, it will be impossible to jump to that link. The more important problem is that search engines don’t see such addresses. That means that the site won’t be indexed entirely. Besides, a user can see the link address in the status bar when he turns the mouse cursor over it, so it would be good to show him something nicer instead of useless internal information about the project. Such links as http://CallbackPage.SoftAIN.com/Rus/Help/PathHolder/Members.aspx are much more functional. They contain information about the site organization, can be sent by e-mail and are indexed by search engines that consider them the addresses of static pages. The fact that scripts in a browser are turned off doesn’t influence static links behaviour. The site will be operational anyway.

The PathHolder class, together with the UserControlHolder class ensures the functionality of a dynamic site when a user works with static links. If you have familiarized yourself with the recommendations of applications development, you should know that the site has only one main page. A link with the address http://CallbackPage.SoftAIN.com/Rus/Help/PathHolder/Members.aspx on the site does not mean that the root directory has such nested subdirectories as Rus, Help, PathHolder and also the Members.aspx page in the last directory. The address is just text information that is analyzed by the PathHolder class and transformed into a set of parameters used by the application. You can find more detailed information about it in url parsing topic. The site behaviour after the analysis of the static link depends on a client’s browser. If it supports JavaScript, a redirect to the main page takes place (the main page is defined by the DefaultPage parameter) and the site remains operational as standard AJAX application. Without JavaScript there is no redirect, and a user (or a search engine) goes on working with the site using static links.

Замечание Note

As a class forming static links and continuing to support the standard behaviour for server ASP.NET controls, you may use NavigationButton included in the example of the use of the UserControlHolder class. You can download the example here. The NavigationButton class is not documented but is available in source, which allows you to learn and, if necessary, change its functionality.

To use the PathHolder class in your project, you must register it in the Web.config file:

<httpModules>
    <add name="PathHolder" type="SoftAIN.PathHolder, CallbackPage"/>
</httpModules>
                

Except the functionality regarding the address analysis, the PathHolder class allows showing the position of a user on the site, which might be useful when he/she saves current links. Topic address located at the top of each topic is nothing else but the PathHolder object located in that place as shown in the example below. Information about the current status is gathered with the help of the controls implementing the PathHolder.IPathInfo interface. Another interface declared in the PathHolder class is PathHolder.ISiteMapInfo, which allows creating a site map.

CollapseExample

<CallbackPage:PathHolder runat=server id="CurrentPathHolder" CssClass="CurrentURL"/">

CollapseИерархия наследования

CollapseSee also

Copyright © 2005-2007 SoftAIN