Ejemplo n.º 1
0
        /// <summary> Chseck to see if included file exists, and display "not found" page if it
        /// doesn't. If "not found" page does not exist, Log an Error and return
        /// null.
        ///
        /// </summary>
        /// <param name="includeResourcePath">
        /// </param>
        /// <param name="currentResourcePath">
        /// </param>
        /// <param name="directiveName">
        /// </param>
        /// <returns> message.
        /// </returns>
        public virtual string IncludeEvent(string includeResourcePath, string currentResourcePath, string directiveName)
        {
            /**
             * check to see if page exists
             */
            bool exists = (rs.GetLoaderNameForResource(includeResourcePath) != null);

            if (!exists)
            {
                if (rs.GetLoaderNameForResource(notfound) != null)
                {
                    return(notfound);
                }
                else
                {
                    /**
                     * can't find not found, so display nothing
                     */
                    rs.Log.Error("Can't find include not found page: " + notfound);
                    return(null);
                }
            }
            else
            {
                return(includeResourcePath);
            }
        }