I'm having issues with one of my controller actions .
I have a decimal stored in my viewbag on my view. And am attempting to pass this via and actionlink to my controller method.
ViewBag.Interest =1.25
@Html.ActionLink("Export", "ExportInterest", "Export", new {id = ViewBag.Interest}, null).
My controller method looks something like this :
public ActionResult ExportInterest(decimal? id)
{
return View();
}
I can see the 1.25 be passed via query string but I'm getting a 404 file not found when it's being routed. Note: if I change it to just a whole number with no decimal point it's working fine. Is this an encoding error ? It's not recognising the decimal point , perhaps I need to escape it ? Is there a htmlhelper I should be using? Initially I thought it might be a localisation thing but I have my globalisation culture set up in my web.config. I'm obviously doing something silly here....any help would be appreciated...
Update: I have also tried casting my viewbag to a nullable decimal in the action link but this didn't have any effect