Skip to content
Loading
  • +1
    I'm not use .cshtml file .I have use ResetPassword screen for reset password (.html file)
    +1
  • Mageshwaran R
    0
    1. var tempdata = (List<string>)TempData["SourabhDhiman"];  
    2. foreach (string str in tempdata )  
    3. {  
    4.     @(new HtmlString(str))  
    5. }  
    6.   
    7. Or   
    8.   
    9. var tempdata = (List<string>)TempData["SourabhDhiman"];  
    10. foreach (string str in tempdata)  
    11. {  
    12.     @(Html.Raw(str))  
    13. }  
    0
  • 0
    Hello,
     
    You can use TempData in HTML using @tempdata
     
    Refer these article for Tempdata:
    https://www.c-sharpcorner.com/article/passing-data-from-controller-to-view-with-tempdata-part-four/
    https://www.c-sharpcorner.com/article/using-tempdata-viewdata-and-viewbag-in-Asp-Net-mvc-5-0-par/ 
    0