Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • pikej 27 posts 47 karma points
    Jan 29, 2011 @ 21:24
    pikej
    0

    passing value to macro

    hi guys,

    I try to pass a value to macro that is built on web user control ascx. For some reason it is not working, I use: 

     

    <umbraco:Macro Alias="userControl" downloadUrl="http://google.com" runat="server"></umbraco:Macro>

    and the bit of the code in ascx.cx is:

     

     protected void Page_Load(object sender, EventArgs e)

        {

            if (!IsPostBack)

            {

                Session["time"] = DateTime.Now.AddSeconds(10);

            }

        }

        public string downloadUrl {

            get { return (String)Session["downloadUrl"];  }

            set {Session["downloadUrl"] = value;}

        }

        protected void Timer1_Tick(object sender, EventArgs e)

        {

            TimeSpan time1 = new TimeSpan();        

            time1 = (DateTime)Session["time"] - DateTime.Now;

            if (time1.Seconds <= 0)

            {

                   Response.Redirect(downloadUrl);

            }

            else

            {

                Label1.Text = "wait " + time1.Seconds.ToString() + " seconds.";

            }

        }

     

    I also added downloadUrl parameter in macro (as text).
    Why it doesn't work?
    thanks in advance

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 29, 2011 @ 21:31
    Jan Skovgaard
    0

    Hi Pikej

    How is your development cycle? Do you manually move files to the Umbraco installation or are you using xcopy?

    Have you remembered to copy file assembly from the bin folder as well? Are you sure the reference to the .ascx file has been setup correctly in the macro in Umbraco?

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 29, 2011 @ 21:31
    Jan Skovgaard
    0

    Hi Pikej

    How is your development cycle? Do you manually move files to the Umbraco installation or are you using xcopy?

    Have you remembered to copy file assembly from the bin folder as well? Are you sure the reference to the .ascx file has been setup correctly in the macro in Umbraco?

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft