Click here to Skip to main content
15,892,161 members
Articles / Web Development / HTML

Providing Web Applications with Context Sensitive Help Using RoboHelp WebHelp

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
23 Apr 2008CPOL11 min read 72.9K   1.5K   17  
This article shows how to implement context sensitive help for your ASP.NET web applications using RoboHelp WebHelp.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Class to determine a help file page name from a help ID
/// </summary>
public class HelpMap
{
	public HelpMap()
	{
		//
		// TODO: Add constructor logic here
		//
	}


	static public string GetHelpLink(BasePage bp, string strCaption)
	{
		string strHelpPage = GetHelpFileName(bp.m_nPageID);

		// a link to a help page has a look like:
		// http://www.mydomain.com/WebHelp/WebHelp_Demo.htm#SepecificHelpPage.htm

		// useful to have help open in a new window
		string strTarget = " target=\"_blank\" ";

		return "<a href=\"" + bp.ResolveUrl("~/WebHelp/WebHelp_Demo.htm") + "#" + strHelpPage + "\" " + strTarget + ">" + strCaption + "</a>";
	}



	static protected string GetHelpFileName(int nPageID)
	{
		// this page determines the name of the help file from the BasePage.HelpID
		
		switch (nPageID)
		{
			// revision details
			case BasePage.Topic1: return "Topic1.htm";
			case BasePage.Topic2: return "Topic_2.htm";
			case BasePage.Topic3: return "Topic_3.htm";
		}

		// return the web site home page by default
		return "Welcome";
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
President Starpoint Software Inc.
United States United States
Bob Pittenger is founder and President of Starpoint Software Inc. He holds a B.A. degree from Miami University, M.S. and Ph.D. degrees from Purdue University, and an MBA from Xavier University. He has been programming since 1993, starting with Windows application development in C++/MFC and moving to C# and .NET around 2005 and is a .NET Microsoft Certified Professional Developer.

Bob is the author of two books:
Billionaire: How the Ultra-Rich Built Their Fortunes Through Good and Evil and What You Can Learn from Them
and
Wealthonomics: The Most Important Economic and Financial Concepts that Can Make You Rich Fast.
Visit http://www.billionairebook.net for more information.

Comments and Discussions