I am trying to move on service page using viewbag link
I get a viewbag text successfully but not get the link
HomeController.cs
- [HttpGet]
- public ActionResult Service()
- {
- ViewBag.text = this.ControllerContext.RouteData.Values["action"].ToString(); //get the action name
- ViewBag.link = "https://localhost:44349/Home/Service";
- return View();
- }
Service.cshtml
- "color:black;" href="@ViewBag.link">@ViewBag.text //link is perfectly work out side the card
- class="card" style="width: 80rem;margin-top:120px;margin-left:120px;">class="row">class="card-img-overlay d-flex">
"~/Graphics/homeiconservicepage.svg" style="width:25px;height:25px;" /> //link is not work inside the card that is issue
- "color:white;" href="@ViewBag.link">@ViewBag.text
see the console log view page source:
help2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sachin SinghPosted Oct 14, 2020, 2:17 AM
class
="card-title">Card titleclass
="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.Mageshwaran RPosted Oct 14, 2020, 2:26 AM