Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
How to bind title in MVC using knockout

I am trying to display a title on the image. When I am on the signing page, the data-bind title working fine and I can see the title displaying over the image. However, as soon as I sign in, the data-bind title stops working.

 
_layout.cshtml

<nav class="navbar navbar-fixed-top">
        <div class="container" style="width:100%">
            <div class="navbar-header" style="height:50px">
                <a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand" 
                   style="margin-left:2px;margin-top:12px;padding:0px;margin-top:7px">
                    <img style="margin-top:4px;height:32px;" data-bind="attr: {title: versionNumber()}" src="~/images/Scheduler-transparent.png" />
                </a>
            </div>
            @await Html.PartialAsync("_LoginPartial")

        </div>
    </nav>

JS file that gets value I want to display on the logo

// versionNumber.js

var versionNumber = ko.observable('');

var url = window.location.origin + '/account/GetVersionNumber';

CallService("Get", url)
    .done(function (data) {
        versionNumber(data);
        console.log("Version number", versionNumber());
    });

The title on signing page is being added on img element enter image description here

But not after I sign in enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!