I am have an action method Contact with return type (int) and taking (int id) as a parameter.
The problem is that on this route when I pass two digit id, but it not shows, but it shows the id with three digits such as (111) but not showing (1)
enter image description here when I passing id = 1 it is not showing
enter image description here when I passing id = 111 it is showing
HomeController.cs
using _10_TagHelpersDemo.Models;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
namespace _10_TagHelpersDemo.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
return View();
}
public int Contact(int id)
{
return id;
}
public IActionResult Privacy()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}