I know its not safe this way, but the meaning is just to make a page easy avaible only from a complicated link (sent by email) and not by google, etc. I also know its easy to do in XSLT, but as I already have some C# code and .NET controls in my template, I think it would be difficult to move it from the template to XSLT.
Action by URL
Hello
I want to do the following in my template, where the page is called with /page.aspx?pass=123:
If pass=123, do something
else: access denied
How to do this? I guess I need some c# code?
Thanks a lot
/Mathias
You could actually do it simply in XSLT by doing something like this:
By the way, this is obviously not a secure way of controlling access to certain content. I would advise you to actually use the membership provider, have a look at this blog post: http://www.mortenbock.dk/blog/2009/04/01/setting-up-membership-in-umbraco.aspx
Thanks for your reply!
I know its not safe this way, but the meaning is just to make a page easy avaible only from a complicated link (sent by email) and not by google, etc.
I also know its easy to do in XSLT, but as I already have some C# code and .NET controls in my template, I think it would be difficult to move it from the template to XSLT.
I solved it rather simply, but it works, and as long the redirect is server-side, I'm happy :)
private void Page_Load(object sender, System.EventArgs e) { string pass = Request.QueryString["pass"]; if (passCode != "h78h3i8chjkh78fhjn3987njknjf9h") { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","/"); } }
is working on a reply...