Posts

Showing posts from April, 2014

Umbraco Drop Down from Datatypes and URL redirect

@using System.Xml.XPath  @{  XPathNodeIterator preValueRootElementIterator3 = umbraco.library.GetPreValues(????);  preValueRootElementIterator3.MoveNext();  XPathNodeIterator preValueIterator3 = preValueRootElementIterator3.Current.SelectChildren("preValue", "");  <select name="forma" onchange="location = this.options[this.selectedIndex].value;" style="width:220px;background-color:#514e4b;color:#ffffff;box-shadow: 5px 5px 5px #888888;padding:3px;padding-bottom:5px;">  <option value="" style="font-size:1.6em">Playwrights by Category:</option>  @{  while (preValueIterator3.MoveNext())  {    @Html.Raw("<option value=\"my-web-page.aspx" + "?q=" + preValueIterator3.Current.Value + "\">" + preValueIterator3.Current.Value + "</option>");  }  }  </select>  }  You can then do something like this with the Querystr…

Umbraco Razor For Each Where Contains Order

if (Model.NodeById(1066).Children.Where("relatedTo == \""+ @qFilter + "\"").Any())
{  
int counter = Model.NodeById(1066).Children.Skip(10 * @thisPage)
.Take(10).Where("relatedTo.Contains(\""+ @qFilter + "\")").Count();
@Html.Raw("hello")

Umbraco Razor 301 vs 302 Redirect

Umbraco Razor 302 Redirect Response.Redirect(theUrl);

Umbraco Razor 301 Redirect:
Response.StatusCode = 301;
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location", theLocation);
Response.Flush();
Response.End();