I've this link on a page
<% = Html.ActionLink(item.Title, "Edit", "ArticleManagement",
new { id = item.ArticleDataID })%>
and a simple method to receive the article Id
public ActionResult Edit(int id)
{
//Do something
}
Unfortunately, I'm getting an error" parameter dictionary contains a null value for parameter id of int32 for Edit(Int32)..."
When I check the Url, I see something like "http://localhost:59786/ArticleManagement/Edit?Length=17"
What is "Length=17"? and what's doing there? Anyway, so far I'm working with a collection that has only 3 items on it.
Thanks for helping
You need to add null as the last parameter:
<%=Html.ActionLink("Title", "Edit", "ArticleManagement",
new { id = 1 }, new { @class = "link-class", attr = "attribute value" })%>
I think it uses you route values as html attributes without the null.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With