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.
Asked
Active
Viewed 536 times
1 Answers
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
-
where do we have the pageLoad event? – mictes Jan 04 '12 at 19:17
-
Funtion pageLoad is a javascript event. It occurs when a page is loaded or reloaded where document ready is not. – Wes Grant Jan 05 '12 at 13:27