Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...DNN 5.5.0 Could not load type, DotNetNuke.Framework.Reflection.CreateTypeDNN 5.5.0 Could not load type, DotNetNuke.Framework.Reflection.CreateType
Previous
 
Next
New Post
7/17/2011 3:30 PM
 
This error is giving me a headache. Can anyone help me? I created a module and I keep getting this at the DNN Log Viewer. I'm using DNN 5.5.0

DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 868d92eb-6567-41be-a86a-cd5bc47d9fb9
InnerException: Could not load type 'XXX.Modules.News.NewsSummaryController'.
FileName
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.Compilation.BuildManager.GetType
StackTrace
Message: System.Web.HttpException: Could not load type 'Pernix.Modules.News.NewsSummaryController'.at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throw , Boolean ignoreCase)at DotNetNuke.Framework.Reflection.CreateType(String TypeName, String CacheKey, Boolean UseCache, Boolean IgnoreErrors)
 
New Post
7/17/2011 9:00 PM
 
Thats a custom external module, you'll need to contact the development company to get a solution.

Philip Beadle - Employee
 
New Post
7/18/2011 9:32 AM
 
Thanks for your quick reply; the thing is that the module was developed for our company by someone that is no longer with us.  Here's the .ascx for that module

namespace Pernix.Modules.News.NewsSummary
{
    /// -----------------------------------------------------------------------------
    /// <summary>
    /// The ViewNewsSummary class displays the content
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    partial class ViewNewsSummary : PortalModuleBase, IActionable
    {


        #region Private Members


        private string strTemplate;


        #endregion


        #region Public Methods


        public bool DisplayAudit()
        {
            bool retValue = false;


            if ((string)Settings["auditinfo"] == "Y")
            {
                retValue = true;
            }


            return retValue;
        }
        NewsDataContext newscontext;


        public NewsDataContext NewsContext
        {
            get
            {
                if (Null.IsNull(newscontext))
                    newscontext = new NewsDataContext();
                return newscontext;
            }


        }
        private int TotalPages = -1;


        private int TotalRecords;
        private int _CurrentPage = 1;
        public int CurrentPage
        {
            get
            {
                return _CurrentPage;
            }
            set
            {
                _CurrentPage = value;
            }
        }


        #endregion


        #region Event Handlers


        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                   LoadData();
                   if (rptPageNumbers.Items != null && rptPageNumbers.Items.Count >0)
                   {
                       LinkButton btn = (LinkButton)rptPageNumbers.Items[0].FindControl("currentPage");
                       if (btn != null)
                           btn.CssClass = "pager_active";
                   }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }


        }


        protected void lstContent_ItemDataBound(System.Object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
        {
            string strContent = string.Empty;
            string strValue = Null.NullString;
            string newsUrl = string.Empty;
            News.Model.News news = (News.Model.News)e.Item.DataItem;
            news.NewsCategoryReference.Load();
            news.TabsReference.Load();
            LoadCommentsCount(news, (Label)e.Item.FindControl("lblComments"));
            strContent = Server.HtmlDecode(news.Summary);




            //assign the content
            Label lblCategory = (Label)e.Item.FindControl("lblCategory");
            Label lblContent = (Label)e.Item.FindControl("lblContent");
            HyperLink tabLink = (HyperLink)e.Item.FindControl("hlkTitle");
            HyperLink hlkMore = (HyperLink)e.Item.FindControl("hlkMore");
            HyperLink hlkAudio = (HyperLink)e.Item.FindControl("cmdAudio");
            Label lblAudio = (Label)e.Item.FindControl("lblAudio");
            LoadAudio(news.NewsID, hlkAudio, lblAudio);
            newsUrl = GetNewsUrl(news);
            tabLink.NavigateUrl = newsUrl;
            hlkMore.NavigateUrl = newsUrl;
            lblCategory.Text = news.NewsCategory.CategoryName;
            string dataTag = Localization.GetString("DateTag", LocalResourceFile);
            string contentFormat = strContent;
            if (!string.IsNullOrEmpty(dataTag) && strContent.Contains(dataTag))
            {
                contentFormat = strContent.Replace(dataTag, string.Format("<span class ='news_contentdate'>{0}.</span>", news.PublishDate.ToString("dd/MM/yyyy")));
            }
            else
            {
                contentFormat = string.Format("<span class ='news_contentdate'>{0}.</span>{1}",
                news.PublishDate.ToString("dd/MM/yyyy"), strContent);
            }


            lblContent.Text = contentFormat;
        }


        
        private void LoadAudio(int NewsID, HyperLink link, Label text)
        {
            string file = GetAudioURL(NewsID);


            if (!string.IsNullOrEmpty(file))
            {
                string url = GetNewsUrlAndAudio(NewsID);
                text.Text = "Escuchar";
                text.Style.Add("display", "block");
                link.Style.Add("display", "block");
                link.NavigateUrl = url;
                //link.Attributes.Add("onClick", "playSound('" + url + "');");


            }
            else
            {
                text.Style.Add("display", "none");
                link.Style.Add("display", "none");


            }
        }


        public string GetAudioURL(int NewsID)
        {
            NewsDataContext context = new NewsDataContext();
            string fileurl = string.Empty;
            News.Model.NewsAttachedFiles attachedFiles = context.NewsAttachedFiles.FirstOrDefault(a => a.News.NewsID == NewsID);
            if (attachedFiles != null)
            {
                attachedFiles.FilesReference.Load();
                FolderController folderController = new FolderController();
                FolderInfo folderInfo = folderController.GetFolderInfo(PortalId, attachedFiles.Files.FolderID);
                
                fileurl = string.Format(@"http://{0}/{1}/{2}/{3}", Request.Url.Host, PortalSettings.HomeDirectory, folderInfo.FolderName, attachedFiles.Files.FileName);
               
            }




            return fileurl;
        }


        public string GetNewsUrlAndAudio(int newsID)
        {
            NewsDataContext context = new NewsDataContext();
            News.Model.News news = context.News.Where(n => n.NewsID == newsID).FirstOrDefault();
            news.TabsReference.Load();
            if (news != null && news.Tabs != null)
            {
                return Globals.NavigateURL(news.Tabs.TabID, "", string.Format("NewsId={0}", news.NewsID), string.Format("PlayAudio={0}", true));
            }
            else
                return string.Empty;
        }


        public string GetNewsUrl(int newsID)
        {
            //NewsDataContext context = new NewsDataContext();
            News.Model.News news = NewsContext.News.Where(n => n.NewsID == newsID).FirstOrDefault();
            news.TabsReference.Load();
            if (news != null && news.Tabs !=null)
            {
                return Globals.NavigateURL(news.Tabs.TabID, "", string.Format("NewsId={0}", news.NewsID));
            }
            else
                return string.Empty;
        }


        public string GetNewsUrl(News.Model.News news)
        {
            if (news.Tabs == null)
                return string.Empty;
            return Globals.NavigateURL(news.Tabs.TabID, "", string.Format("NewsId={0}", news.NewsID));
        }


        public string GetEditUrl(int newsID)
        {
            return Globals.NavigateURL(62, "", string.Format("EditView={0}&ItemID={1}", true, newsID));


        }


        private void LoadCommentsCount(News.Model.News news, Label commentsLabel)
        {
            if (news != null &&  news.Tabs !=null && commentsLabel != null)
            {
                CodingStaff.Modules.Comments.CommentsService comments = new CodingStaff.Modules.Comments.CommentsService();
                int commentsCount = comments.GetCommentCount(Convert.ToInt32(news.CommentsModuleID), news.Tabs.TabID, Null.NullInteger);
                commentsLabel.Text = string.Format(Localization.GetString("Comments.Text", LocalResourceFile), Convert.ToUInt32(commentsCount));
            }
        }


        private void FillPage(IEnumerable<Model.News> newslist, int nextPage, int totalRecords)
        {


            var currentPage = newslist.OrderBy(p => p.Priority)
                .Skip((nextPage - 1) * Utils.PageSize).Take(Utils.PageSize);
            //bind the content to the repeater
            lstContent.DataSource = currentPage;
            lstContent.DataBind();


        }


        private void LoadData()
        {
            //refresh cache
            ModuleController.SynchronizeModule(ModuleId);
            int totalRecords = 0;




            var newslist = from news in NewsContext.News
                           where news.NewsCategory.Tabs.TabID == PortalSettings.ActiveTab.TabID
                           && !news.IsNewsletter && !news.IsInterview 
                           && news.PublishDate <= DateTime.Now //&& news.ExpirationDate >= DateTime.Now
                           orderby news.Priority ascending, news.PublishDate descending
                           select news;






            if (newslist == null)
                return;


            totalRecords = newslist.Count();




            int startPage = 1;
            if (CurrentPage != Null.NullInteger)
                startPage = CurrentPage;




            string[] pageNumbers;


            pageNumbers = Utils.GetPageNumbers(1, totalRecords);
            if (pageNumbers != null && pageNumbers.Count() > 0)
            {
                if (pageNumbers[pageNumbers.Count() - 1] == ">")
                    ViewState["LastPage"] = pageNumbers[pageNumbers.Count() - 2];
                else
                    ViewState["LastPage"] = pageNumbers[pageNumbers.Count() - 1];
                ViewState["FirstPage"] = 1;
            }




            rptPageNumbers.DataSource = pageNumbers;
            rptPageNumbers.DataBind();






            FillPage(newslist, 1, totalRecords);
            //refresh cache
            ModuleController.SynchronizeModule(ModuleId);
        }




        protected void cmdFilter_Click(object sender, EventArgs e)
        {
            LoadData();
        }


        private void ClearPageStyle()
        {
            foreach (RepeaterItem item in rptPageNumbers.Items)
            {
                LinkButton btn = (LinkButton)item.FindControl("currentPage");
                if(btn != null)
                    btn.CssClass = "pager";
            }
            
        }
        protected void currentPage_Click(object sender, EventArgs e)
        {
            try
            {
                //refresh cache
                ModuleController.SynchronizeModule(ModuleId);
                ClearPageStyle();
                LinkButton pageButton = (LinkButton)sender;
                string selectedLink = Convert.ToString(pageButton.CommandArgument);
                double selectedPage;


                var newslist = from news in NewsContext.News
                               where news.NewsCategory.Tabs.TabID == PortalSettings.ActiveTab.TabID
                               && !news.IsNewsletter && !news.IsInterview
                               && news.PublishDate <= DateTime.Now && news.ExpirationDate >= DateTime.Now
                               orderby news.Priority ascending, news.PublishDate descending
                               select news;


                bool isNum = Double.TryParse(Convert.ToString(selectedLink), out selectedPage);


                if (!isNum)
                {
                    string[] pageNumbers;
                    int startPage = 1;


                    if (selectedLink == "<")
                    {
                        startPage = 1;
                        if (ViewState["FirstPage"] != null)
                        {
                            int firstPage = Convert.ToInt32(ViewState["FirstPage"]);
                            if (firstPage > Utils.MaxPagesToShow)
                                startPage = (firstPage - Utils.MaxPagesToShow) - 1;
                        }


                        pageNumbers = Utils.GetPageNumbers(startPage + 1, newslist.Count());
                        if (pageNumbers != null && pageNumbers.Count() > 0)
                        {
                            if (pageNumbers[pageNumbers.Count() - 1] == ">")
                                ViewState["LastPage"] = pageNumbers[pageNumbers.Count() - 2];
                            else
                                ViewState["LastPage"] = pageNumbers[pageNumbers.Count() - 1];


                            ViewState["FirstPage"] = startPage + 1;
                        }
                        rptPageNumbers.DataSource = pageNumbers;
                        rptPageNumbers.DataBind();


                        FillPage(newslist, startPage, newslist.Count());


                    }
                    else
                    {
                        if (ViewState["LastPage"] != null)
                            startPage = Convert.ToInt32(ViewState["LastPage"]);


                        pageNumbers = Utils.GetPageNumbers(startPage + 1, newslist.Count());
                        if (pageNumbers != null && pageNumbers.Count() > 0)
                        {
                            if (pageNumbers[pageNumbers.Count() - 1] == ">")
                                ViewState["LastPage"] = pageNumbers[pageNumbers.Count() - 2];
                            else
                                ViewState["LastPage"] = pageNumbers[pageNumbers.Count() - 1];
                            ViewState["FirstPage"] = startPage + 1;
                        }
                        rptPageNumbers.DataSource = pageNumbers;
                        rptPageNumbers.DataBind();




                        FillPage(newslist, startPage + 1, newslist.Count());


                    }
                }
                else
                    FillPage(newslist, (int)selectedPage, TotalRecords);


                pageButton.CssClass = "pager_active";
                //refresh cache
                ModuleController.SynchronizeModule(ModuleId);
            }
            catch (Exception ex)
            {
            }
        }








        #endregion


        #region Optional Interfaces


        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Registers the module actions required for interfacing with the portal framework
        /// </summary>
        /// <value></value>
        /// <returns></returns>
        /// <remarks></remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public ModuleActionCollection ModuleActions
        {
            get
            {
                ModuleActionCollection Actions = new ModuleActionCollection();
                Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "action_settings.gif", EditUrl(), false, SecurityAccessLevel.Edit, true, false);




                return Actions;
            }
        }


        #endregion

}
}
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...DNN 5.5.0 Could not load type, DotNetNuke.Framework.Reflection.CreateTypeDNN 5.5.0 Could not load type, DotNetNuke.Framework.Reflection.CreateType


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out