Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

store data between razor pages

//When you redirect somewhere, you can also set this values that will show in the url of
//the next page, you can also send other data, not only strings
public IActionResult OnGet()
{
    return RedirectToPage("Query", new { name1 = "value1"});
}

//Then, inside the onget method you can get the value with an external variable
    public void OnGet(string name)
    {
        Name = name;
    }

Source by www.learnrazorpages.com #
 
PREVIOUS NEXT
Tagged: #store #data #razor #pages
ADD COMMENT
Topic
Name
1+1 =