Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

149
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda