I have a number of content pages that are using the same template. On my document type I have a radiobuttonlist. I'm hoping that with some inline asp.net within my content pages template I can capture the value of that radiobuttonlist.
Oh and better still since its a radiobutton I need to be able to do something like what umbraco.library:GetPreValueAsString does in xslt so that I get the actual string value.
Get a page field value in ASP.Net
I have a number of content pages that are using the same template. On my document type I have a radiobuttonlist. I'm hoping that with some inline asp.net within my content pages template I can capture the value of that radiobuttonlist.
i.e. something like
<%
string myVariable = some.umbraco.library(CurrentPage.Field("fieldname"));
if (myVariable == "some value") then
....etc
%>
Oh and better still since its a radiobutton I need to be able to do something like what umbraco.library:GetPreValueAsString does in xslt so that I get the actual string value.
Is this possible?
I figured it out:
<%@ import namespace="umbraco.BusinessLogic" %>
<%@ import namespace="umbraco.cms.businesslogic.web" %>
<%
Document doc = new Document(umbraco.presentation.UmbracoContext.Current.PageId.Value);
int groupID = Convert.ToInt32(doc.getProperty("groupNamePicker").Value);
string groupName = umbraco.library.GetPreValueAsString(Convert.ToInt32(groupID));
%>
is working on a reply...