Hi,
I am using ASP.NET MVC 3 and I need to generate a URL like this : MyURL.se/?CS.C2=113
I have tried this :
<%= Html.ActionLink(subItem.Name, "List", "Ad", new { CS.C2=subItem.Id}, null) %>
But this will throw a : CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.
CS.C2 is part of the viewClass that the action needs.
So how do I generate a proper URL for this link?
Edit :
public ActionResult List(AdList data)
{
//Fill data
return View(data);
}
I have tried this : https://stackoverflow.com/a/10011614/1490727 but it throws :
No parameterless constructor defined for this object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.