Anyone can tell what is wrong here ? I cant convert to Int64 and my cshtml file keeps giving me an ugly error message.
int Id = Convert.ToInt32(library.GetDictionaryItem("as"));
var folder = new Media(Id);
IEnumerable<Media> fd = folder.GetChildMedia();
<div class="docCn-">
<div id="docMnu-">
<ul>
@foreach(var p in fd){
@foreach(var p in fd){
var bytes = Convert.ToInt64(@p.getProperty("umbracoBytes").Value);
}
</ul>
</div>
</div>
Converting to Int64 Failed
Anyone can tell what is wrong here ? I cant convert to Int64 and my cshtml file keeps giving me an ugly error message.
Hi Fujl,
Is it meant that you should have two foreach loops or should you only have one like this:
/Dennis
Dennis i just happened to notice that some of the Media Items dont have any file attached to it and so fails.
You should really use Int64.TryParse It wont throw an execption :) Charlie
is working on a reply...