-2

I am customizing the ribbon toolbar and adding a button to it. Whenever I click on that button, it will open a aspx page allows authors to select some data, which gets appended to the existing RTF field content.

But when popup is opened it is having the below error in the browser (Internet Explorer).

I am inheriting Tridion page in the code behind file. When I try to use Response.Write() functions it is giving error like "Expected ;". Please tell me the reason why it is giving the error like that? Early responce is appreciated. Thanks in advance.

PFB the related code: Aspx page code behind file contents:

namespace ButtonReference.Popups
{     
    [ControlResourcesDependency(new Type[] { typeof(Popup), typeof(Tridion.Web.UI.Controls.Button), typeof(Stack), typeof(Dropdown), typeof(List) })]
    [ControlResources("RTFExtensions.ButtonReferenece")]
    public partial class PopupReference : TridionPage
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            TridionManager tm = new TridionManager();

            tm.Editor = "PowerTools";
            System.Web.UI.HtmlControls.HtmlGenericControl dep = new System.Web.UI.HtmlControls.HtmlGenericControl("dependency");
            dep.InnerText = "Tridion.Web.UI.Editors.CME";
            tm.dependencies.Add(dep);

            System.Web.UI.HtmlControls.HtmlGenericControl dep2 = new System.Web.UI.HtmlControls.HtmlGenericControl("dependency");
            dep2.InnerText = "Tridion.Web.UI.Editors.CME.commands";
            tm.dependencies.Add(dep2);

            //Add them to the Head section 
            this.Header.Controls.Add(tm); //At(0, tm); 
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            mySession = new Tridion.ContentManager.Session(@"");
            if (!Page.IsPostBack)
            {
                try
                {
                   if (true)                   
                             {}
                    else
                    {
                        //Response.Write("Invalid schema chosen");
                        return;
                    }
                }
            }
        }
    }
P.Muralikrishna
  • 1,279
  • 9
  • 30
  • 1
    Just like on most questions, if you show us the code that generates this error we'll find it much easier to help you spot the error in it. – Frank van Puffelen Apr 09 '12 at 12:16
  • @Frank Please refer this question.I provided the code in this question. http://stackoverflow.com/questions/10028501/how-to-resolve-tridion-is-undefined-error-in-a-tridion-popup-page – P.Muralikrishna Apr 09 '12 at 12:20
  • 5
    Questions should be self-contained. So copy the relevant code here. Try and reduce the code to the minimum needed to reproduce the problem. Remember: you are asking for a lot of help on this forum, so it is your responsibility to make it as easy as possible on this that are trying to help. – Frank van Puffelen Apr 09 '12 at 12:59
  • 1
    +1 for @FrankvanPuffelen. For reference, Eric Steven Raymond gives an excellent guide on asking questions at: http://www.catb.org/~esr/faqs/smart-questions.html. – Alvin Reyes Apr 09 '12 at 15:04
  • I suggest first removing all Tridion-related code from the code-behind. If the problem still persists, it is not related to your interaction with Tridion and you stand a better chance of getting an answer by only directing it at ASP.NET experts. – Frank van Puffelen Apr 10 '12 at 20:17

1 Answers1

7

Small remark: since your page will be used as a simple popup, you don't need to load Domain Model related JavaScript stuff. Not loading it will reduce the load time for your page. To do that you need to set IsStandAloneView Tridion Manager property to false:

tm.IsStandAloneView = false;
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Boris Ponomarenko
  • 1,324
  • 6
  • 7