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 Querystring from the new page:
 
 
 
 



Comments

  1. Great resources’ really appreciate for posting such a great Blog. Umbraco Development

    ReplyDelete

Post a Comment

Popular posts from this blog

Umbraco Razor Sort Nodes Ascending or Descending

Umbraco Razor get Querystring

Create a .NET Contact Form that Gets the Last Url Visited in C# Can also be Used in Umbraco