I'm having a similar problem. I narrowed it down to the forward slashes in the parameter value. I've tried to escape it with both // and \/ both it doesn't seem to have an effect.
How are your developlment setup? Do you copy the user control and the files in the bin folder manually or are you using xcopy to do this when you're building?
Have you remembered to copy the .dll file in the bin folder into the folder as well?
Is the reference to the user control in the macro setup properly?
I didn't do dll file but after your reply I tried to add it an I think it is there (I put them via ftp into umbraco files).
The difference now is that when I add macro it actually asks me for the value of downloadUrl. So there is a slow progress, but the whole thing still doesn't work.
Maybe I do it all wrong, all I want to achieve is a page that waits a few seconds before redirecting to a download file. I have all the code in aspx but cannot implement it to umbraco :( . Maybe you have another idea, how to postpone a page from loading for a few seconds in umbraco?
I will have another go tomorrow morning and let you know.
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'm having a similar problem. I narrowed it down to the forward slashes in the parameter value. I've tried to escape it with both // and \/ both it doesn't seem to have an effect.
Hi Guys
How are your developlment setup? Do you copy the user control and the files in the bin folder manually or are you using xcopy to do this when you're building?
Have you remembered to copy the .dll file in the bin folder into the folder as well?
Is the reference to the user control in the macro setup properly?
/Jan
hi Jan,
I didn't do dll file but after your reply I tried to add it an I think it is there (I put them via ftp into umbraco files).
The difference now is that when I add macro it actually asks me for the value of downloadUrl. So there is a slow progress, but the whole thing still doesn't work.
Maybe I do it all wrong, all I want to achieve is a page that waits a few seconds before redirecting to a download file. I have all the code in aspx but cannot implement it to umbraco :( . Maybe you have another idea, how to postpone a page from loading for a few seconds in umbraco?
I will have another go tomorrow morning and let you know.
all the best,
pikej
Hi Pikej
Maybe you can benefit from watching some of the free videos on creating user controls here: http://umbraco.tv/products/umbracotv
Have a look at Using .NET user controls and Macro parameters.
Hope this helps.
/Jan
is working on a reply...