Wednesday, August 22, 2012

An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter

I got this error when i redirect to another action with parameters.
In my case, the problem was parameter name. Add correct parameter.

return RedirectToAction("ProductTryout", new RouteValueDictionary(new { controller = "Catalog", action = "ProductTryout", productId = model.Id }));

No comments:

Post a Comment

How to Create Events Using Microsoft Graph API with Delegated Permissions and MSAL.js

Microsoft Graph API provides powerful capabilities to interact with Microsoft 365 services. In this guide, we’ll explore how to create calen...