The project works like this. You click on a Project name and it takes you to a Chart. My Chart is configured to receive the string value (ie. Project Name that is clicked on) What do I need to do to make the following work:
My FirstView that will send the string parameter:
@projectOverviewa.DisplayProject_Name_1 //This gets my project's name from the DB table
@Html.ActionLink("View", "ChartForProject", new { id = item.rowid } //here it should get the name of the project clicked on. (For the code above)
The Controller:
public ActionResult SecondViewForChart()
{
string getName = Session["projectname"].ToString(); //AThe ActionLink should send the string value to here for me to use in the CHhart.
return View();
}
Not sure about using the Session though.
You are sending the parameter (
item.rowid) as a part of query string (part of the url). The easiest way to get it is to use the model binding that ASP.NET has and change your action method to: