
上QQ阅读APP看书,第一时间看更新
Activity: Finding the Correct Method Invoked for a URL
Scenario
There has been a cyber attack in your company. The administrator wants to know which method has been invoked by the hacker by sending you the malicious URL.
Aim
To find the correct method invoked for the given URL (http://localhost/Hello3/Welcome/1).
Steps for completion
Open your editor and type the following code:
Go to https://goo.gl/2Jy3W4 to access the code.
public class Hello3Controller : Controller
{
public ActionResult Welcome(int id)
{
return View();
}
...
...
{
return View();
}
}
Once the request reaches the controller, the controller will create a response by talking to the model and may pass the data to the view, and the view will then be rendered to the end user.
We will discuss routing in detail in a later chapter.