0

I have a header in my master page which i want to enable it in my login page. I am doing it using document.onready event. But when I submit the page and if the model validation fails, it doesn't show the header. Is there any javascript that gets called when the mvc validation fails or when the page gets reloaded.

mictes
  • 33
  • 3

1 Answers1

0

There is a pageLoad event that you can use.

function pageLoad() { 
    // Initialization code here, meant to run once. 
} 

Here is an article about the differences between document ready and pageLoad.

http://encosia.com/document-ready-and-pageload-are-not-the-same/

You can also attach an event in the partial view, there is a post about adding events here: Javascript that executes after page load

Community
  • 1
  • 1
Wes Grant
  • 1,754
  • 13
  • 14