Click here to Skip to main content
11,712,241 members (73,889 online)
Click here to Skip to main content
Articles » Web Development » Ajax » General » Downloads
Add your own
alternative version

Context Sensitive Help using Client Callbacks - AJAX Style

, 25 Sep 2006 32.6K 224 35
This article is all about providing Context Sensitive Help in a web page, asynchronously or AJAX style, using Client Callbacks in .NET 2.0.
contextsensitivehelp_src.zip
ContextSensitiveHelpCode
ContextSensitiveHelp_src
ContextSensitiveHelp
App_Code
App_Themes
ControlsTheme
ContextSensitiveHelp.skin
CSS
Database
SampleDataBase.mdb
IMG
ContextSensitiveHelp.gif
Scripts
UserControls
Xml
Messages.dtd
/*
 * Help Control Code Behind Class
 * ==============================================================
 * Creator 			Ch.V.L.Mahendra
 * Created			17-Sep-2006
 * Environments		IIS 5.0, IIS 6.0, .Net Framework 2.0
 * Description 
 * Change Log
 * ==============================================================
 * Version	Date		Author		    Changes
 * 0.1		17-Sep-2006	Ch.V.L.Mahendra	Created
 */

using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;

namespace ContextSensitiveHelp.Pages.UserControls
{

    public partial class HelpControl : System.Web.UI.UserControl
    {

        #region Properties
        /// <summary>
        /// Holds the title for this control
        /// </summary>
        public bool IsVisible
        {
            get
            {
                return csh_Container.Visible;
            }
            set
            {
                csh_Container.Visible = value;
            }
        }
        #endregion

        #region Page Events

        #region Method to handle the Page Load event
        /// <summary>
        /// Method to handle the page load event
        /// </summary>
        /// <param name="sender">The object that caused the event</param>
        /// <param name="e">The parameter containing the event data</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        #endregion 

        #endregion

        #region Public Methods

        #region Method to set the help text

        /// <summary>
        /// This method will set the help text in to the corresponding elements and make
        /// the div tag visible.
        /// </summary>
        /// <param name="sFieldName">The Screen element for which the help text is being shown.</param>
        /// <param name="sHelpText">The help text corresponding to the screen element.</param>
        public void ContextHelpText(string sFieldName, string sHelpText)
        {
            HtmlTableRow objROW = new HtmlTableRow();
            HtmlTableCell objCELL = new HtmlTableCell();
            objCELL.InnerText = sFieldName;
            objCELL.Attributes["title"] = sHelpText;

            objROW.Attributes["onclick"] = "javascript:setFocus('" + sFieldName + "');";
            objROW.Cells.Add(objCELL);
            HelpTextTable.Rows.Add(objROW);
            csh_Container.Visible = true;
        }
              

        #endregion
              

        #endregion

    }

}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Mahi2407
Web Developer
India India
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150819.1 | Last Updated 25 Sep 2006
Article Copyright 2006 by Mahi2407
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid