skip to Main Content

URLs ignore arguments in GET request (ASP.NET)

I need to write a Web API for this request: {apiUrl}/api/sessions/byhour?startTime=2021-06-30T01:00:00&endTime=2021-06-30T03:00:00 So I have this controller and method: [ApiController] [Route("/api/sessions/byhour")] public class LoginStatsByHourController : ControllerBase { [HttpGet, Route("{startTime=0001-01-01T12:00:00}/{endTime=9999-12-31T11:59:59}")] public List<SessionEntry> GetSessionEntryByDate(string startTime, string endTime) {...} } I tested this request:…

VIEW QUESTION

How to call a function in page load asp.net?

The function below is found in a class called page.cs public static List<string> MyFunction() { var retList = new List<string>(); retList.Add("xzy"); retList.Add("abc"); return retList; } On page load how to call the function and check if the list contains xzy…

VIEW QUESTION
Back To Top
Search