c# - Need to aceess master layout controls from a view in MVC -


i have mvc web application master layout , views based on layout.and need display text in label in master layout.

and javascript function in child view.

here master page.

<body onload="setinterval('layouthandler.diplayclock()', 1000);">          <div id="notify">                     @html.label("hi", new { id="lblnotify"})                 </div>  </body 

and here javascript function in view..

 getcustomerdetails: function (customerphonenumber) {              $("#lblnotify").val("calling");         }, 

don't mind javascript function, call function fires signalr.and works fine.the issue can't change text of lblnotify function. identifies lable object, text not changing...

how can slove this???

label rendered in html as:

<label id="lblnotify">hi</label> 

and changing text between tags, need use text():

$("#lblnotify").text("calling"); 

Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -