/>
                  
                  
                  testing
                  
                  
                  And its Page Model
                  
                  
                  
                  
                  
                      public class EditModel : PageModel
                  
                  
                      {
                  
                  
                          [BindProperty(SupportsGet = true)]
                  
                  
                          public int Id { get; set; }
                  
                  
                  
                  
                  
                          public void OnGet()
                  
                  
                          {
                  
                  
                          }
                  
                  
                      }
                  
                  
                  This is working well when I enter /Tasks/Edit/25 or any other route parameter. But when I try to use handler parameter for OnGet and use ViewData such as
                  
                  
                  
                  
                  
                  public void OnGet(int id)
                  
                  
                  {
                  
                  
                    ViewData["id"] = id;
                  
                  
                  }
                  
                  
                  
                  
                  
                   
                  
                  
                  And then changing in razor page to @ViewData["id"] of course, when I enter same endpoint there is empty, no id is being written. Am I implementing second approach incorrectly?
                  
                  
                
Стикер
Обсуждают сегодня