Пример #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            // load the notificationmessage if with have a placeholder control to display it.
            var ctrlMsg = this.FindControl("notifymsg");

            if (ctrlMsg != null)
            {
                var msg = NBrightBuyUtils.GetNotfiyMessage(ModuleId);
                var l   = new Literal {
                    Text = msg
                };
                ctrlMsg.Controls.Add(l);
            }
        }
        private void PageLoad()
        {
            try
            {
                // load the notificationmessage if with have a placeholder control to display it.
                var ctrlMsg = this.FindControl("notifymsg");
                if (ctrlMsg != null)
                {
                    var msg = NBrightBuyUtils.GetNotfiyMessage(ModuleId);
                    var l   = new Literal {
                        Text = msg
                    };
                    ctrlMsg.Controls.Add(l);
                }

                if (CtrlTypeCode != "")
                {
                    // display the detail
                    var l = new List <NBrightInfo>();
                    var moduleSettings = NBrightBuyUtils.GetSettings(PortalId, ModuleId, CtrlTypeCode, false);
                    moduleSettings = EventBeforeRender(moduleSettings);
                    l.Add(moduleSettings);
                    RpData.DataSource = l;
                    RpData.DataBind();

                    //if new setting, save theme and reload, so we get theme settings displayed.
                    if (moduleSettings.ItemID == -1)
                    {
                        UpdateData();
                        Response.Redirect(Request.Url.AbsoluteUri, true);
                    }
                }
            }
            catch (Exception exc)             //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }