-------

-------

  • NA
  • 213
  • 7k

link is not work inside the card

Oct 14 2020 1:41 AM
I am trying to move on service page using viewbag link
 
I get a viewbag text successfully but not get the link
HomeController.cs
  1. [HttpGet]    
  2. public ActionResult Service()    
  3. {    
  4.     ViewBag.text = this.ControllerContext.RouteData.Values["action"].ToString();  //get the action name    
  5.     ViewBag.link = "https://localhost:44349/Home/Service";    
  6.     return View();    
  7. }  
Service.cshtml
  1. <a style="color:black;" href="@ViewBag.link">@ViewBag.text</a>   //link is perfectly work out side the card  
  2.     
  3. <div class="card" style="width: 80rem;margin-top:120px;margin-left:120px;">    
  4.     
  5.     <div class="row">    
  6.         <div class="card-img-overlay d-flex">    
  7.             <img src="~/Graphics/homeiconservicepage.svg" style="width:25px;height:25px;" />   //link is not work inside the card that is issue  
  8.             <a style="color:white;" href="@ViewBag.link">@ViewBag.text</a>    
  9.         </div>    
see the console log view page source:
 
 
help

Answers (2)