I need to take a value through textbox and assign the value inside a action..
i have an action like below..
public ActionResult Edit(int id)
{
id=1 //it works,but if
id=value from view //it does not work
}
How can i solve it??
Passing value from view to controller
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Feb 25, 2015, 7:57 PM EST
If you want to make string input you need to change the signature of this function like
public ActionResult Edit(int id)
to
public ActionResult Edit(string id)
Saineshwar BageriRank #115 · 19.6K reputationPosted Feb 25, 2015, 8:43 PM EST