System.OverflowException: Value was either too large or too small for an Int32.
at System.Convert.ToInt32(Double value)
at System.Double.System.IConvertible.ToInt32(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument,
XmlResolver dataSources, XsltArgumentList argumentList,
XmlSequenceWriter results)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument,
XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter
writer)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable
input, XsltArgumentList arguments, XmlWriter results, XmlResolver
documentResolver)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String
fileName, String oldName, String fileContents, Boolean ignoreDebugging)
Getting radio button value as text
Hi everyone
I have a property called "valgBy", it has a radio button datatype, with multiple choices.
I need some help on how to display the values as text?
I know this should be pretty simple for a pro :)
But I am still a "neewbie" regarding XSLT, so if someone would please help me out? :)
Kind regards
Mikkel Johansen
Hi Mikkel
Try this:
/Kim A
No.. I get an error....
My XSLT looks like this:
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:value-of select="umbraco.library:GetPreValueAsString($currentPage/valgBy)" />
</xsl:for-each>
Do you have any idea what could be wrong?
Ahh you are inside a loop.
Could you try changing it to this then:
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:value-of select="umbraco.library:GetPreValueAsString(./valgBy)" />
</xsl:for-each>
/Kim A
I still get an error:
Error occured
System.OverflowException: Value was either too large or too small for an Int32.
at System.Convert.ToInt32(Double value)
at System.Double.System.IConvertible.ToInt32(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
Does this make any sense to you?
Then you probably need to make a test to check that there's actually a vlue in thevalgBy. Like this:
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:if test="./valgBy!=''">
<xsl:value-of select="umbraco.library:GetPreValueAsString(./valgBy)" />
</xsl:if>
</xsl:for-each>
/Kim A
No, that didn't help either... Does it have anything to do with wich version of umbraco I use?
I am using Umbraco v 4.6.1
Hmm....okay.
Could you try to print out the current value of the valgBy field? Does this containt an id?
/Kim A
Oh, I got working now... Apperantly some of the nodes didnt have any of the radiobutton options selected.
So it seems to work perfectly now... Thank you very much for taking the time to help me out ;)
Ahh great to hear Mikkel. I did sound a little weird, so I'm glad it's working now :)
/Kim A
is working on a reply...