0

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
  • Please help me over this issue Commented Sep 27, 2010 at 9:24

1 Answer 1

1

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

public ActionResult Edit(string id)
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks , Its working. I have to use CRNo insteed of id . thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.