views:

8

answers:

1

Hi, As i showing the list of records in the index view in my asp.net mvc 2 + C# application. on the edit link, I am passing the string value which is the primary key in the db. so that I can access the respective records. but as i set the debugger at the controller in the Edit method , in parameter list I am not getting the value that I have passed. Scenario is like this :

INDEX : View

<%= Html.ActionLink("Edit", "Edit", new { id=item.CRNo }) %> 

In CONTROLLER:

public ActionResult Edit(String CRNo) // Here getting null
    {...some code...}

Where CRNo is string property of item.

+1  A: 

You are passing id as a parameter in the link, so you should read that.

public ActionResult Edit(string id)
Dan Dumitru
Thanks , Its working. I have to use CRNo insteed of id . thanks.
Lalit