My submenu doesn’t display after I add these lines line of code, what should I do instead?
Before I added this code, my submenu worked perfectly, the problem I suspect is window.onload.
The below code work perfectly with the result I want, but it create another problem for me which is my submenu doesnt display anymore
window.onload = function()
{
var element = document.getElementById('<%=lblMessage.ClientID%>');
var lblMsg = document.getElementById('<%=lblAttention.ClientID%>');
lblMsg.style.display = 'none';
if(element.innerHTML.length)
lblMsg.style.display = 'inline';
else
lblMsg.style.display = 'none';
}
the error msg shown in browser
javascript:__doPostBack('ctl00$m$g_0248855d_ee1a_4a57_9508_a520e1f7f8b9$ctl00$MenuReport','Report')
Here is a suggestion
Look at the page source
If you have something like
MOVE the code to the onload like this: