I have tried placing some code in the scriptlet to show a custom link if the user is coming from a certain url but it does not render correctly.
Here is the code:
<% if (Request.UrlReferrer.ToString().Contains("testexchange"))
{
Response.Write("<a href='http://www.exchangeonlinemall.com/defau ... =aafes.com' class='tab'>Return to Mall</a>")
}%>
I have also tried it like this:
# if (Request.UrlReferrer.ToString().Contains("testexchange"))
{
Response.Write("<a href='http://www.exchangeonlinemall.com/defau ... =aafes.com' class='tab'>Return to Mall</a>")
}
#end
Any help is appreciated. Thanks
custom link on default header page
Re: custom link on default header page
Mmm. Can't put asp markup in scriplets - they are .htm files and not rendered that way.
I'd approach this by creating a custom control, say "LinkExchange.ascx", to inspect the origin page and write the appropriate link as an anchor tag, then inject the control in the header.htm as [[ConLib:Custom\LinkExchange]]. More concise in the htm and all the yummy goodness of C# code behind.
Also, Able does rewrites extensively; it's unlikely that Request.UrlReferrer is what you expect. Fortunately they preserve what you are looking for in Session["SessionReferrerUrl"] (Global.asax).
I'd approach this by creating a custom control, say "LinkExchange.ascx", to inspect the origin page and write the appropriate link as an anchor tag, then inject the control in the header.htm as [[ConLib:Custom\LinkExchange]]. More concise in the htm and all the yummy goodness of C# code behind.
Also, Able does rewrites extensively; it's unlikely that Request.UrlReferrer is what you expect. Fortunately they preserve what you are looking for in Session["SessionReferrerUrl"] (Global.asax).
Nick Cole
http://www.ethofy.com
http://www.ethofy.com
Re: custom link on default header page
As nickc said you can't add ASP.NET code to the scriptlets. The better approach will be to create a new user control and handle all ASP.NET stuff in that control and then place it here on the page where you want to have that functionality.
You can't do this using NVelocity because AbleCommerce does support NVeleocity code for some specific Able objects only, not for the ASP.NET constructs.
You can't do this using NVelocity because AbleCommerce does support NVeleocity code for some specific Able objects only, not for the ASP.NET constructs.
Re: custom link on default header page
Hey Mazhar,
I was wondering about that. Is there any way to extend the objects available to the nVelocity engine, or are they defined in the DLL? It looks like a more typical implementation of the engine gives access to Request, Session, etc...
I was wondering about that. Is there any way to extend the objects available to the nVelocity engine, or are they defined in the DLL? It looks like a more typical implementation of the engine gives access to Request, Session, etc...
Nick Cole
http://www.ethofy.com
http://www.ethofy.com