I am new to asp.net, I really want to give an ActionResult parameter.
I want this to be so (I don't know if this is possible)
Sudoku s = new Sudoku();
public ActionResult Index(int value)
{
if(value == 1)
{
myGame.Create();
s.MyFields = myGame.GameField();
}
if(value == 2)
{
myGame.Cheat();
s.MyFields = myGame.GameField();
}
if(value == 3)
return View(s);
}
MyCode - Index.cshtml
@Html.ActionLink("Cheat", "Index")
I want: if I click on the actionlink "Cheat", I can give number 2 to start the Cheat Method and update s.MyFields;
Another code to display the fields that I skipped. I can show the fields on the webpage when I use s.MyFields = mygame.GetFields (). So this is not a problem, the problem is how I can “update” it when I click on cheat.
source
share