I have this code in my view:
<%=Html.ActionLink("Approve", "NewsApprove", New With {ID}, DBNull.Value)%>
in my controller:
Function NewsApprove(ByVal dID As Integer) As ActionResult
dTempNews.ApproveNews(dID)
Return RedirectToAction("Administrator")
End Function
My problem is that it always return an error that says: The parameters dictionary contains a null entry for parameter 'dID' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult NewsApprove(Int32)' in 'UC_Website.UserController'. To make a parameter optional its type should be either a reference type or a Nullable type.
But I don't see any problem with the code. I think this is a simple problem but i can't figure out how to make it work.. Help please. Thank you!