Question

I'm developing a dnn module. And i used codebehind C#. But DNN shows error when I add a the module. Other pages work just fine but the page I add the module to says DotNetNuke error. The error does not have any code and it only displays my logo. Even the admin strip disappears. What did i do wrong?

using System;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Modules.Actions;
using DotNetNuke.Services.Localization;
using DotNetNuke.Security;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Web.UI;
using System.Configuration;

//imports
namespace DotNetNuke.Modules.Catagory
{
    public partial class View : CatagoryModuleBase, IActionable
    {
        public bool inEdit = false;
        private bool IsValid = true;

        #region Event Handlers

        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();
            base.OnInit(e);
        }

        private void InitializeComponent()
        {
            this.Load += new System.EventHandler(this.Page_Load);
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                if (IsPostBack)
                {
                    if (Catagory_Table.SelectedRow != null)
                    { //There is a selected item, hence edit mode Catagory_Table.SelectedIndex >= 0
                        this.inEdit = true;
                        to_edit_mode(); 
                    }
                    else
                    {
                        to_add_mode();
                    }

                }
                else
                {
                    to_add_mode();
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }

        protected void Button1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            SqlDataSource1.Insert();
        }

        //the rest if the methods to handle the buttton events....
}
Was it helpful?

Solution

You will want to try to check the Admin/Event Viewer to see what the error is specifically, then you can be better informed on what it will take to fix.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top