Hi All, Im executing javascript on a master page that is onClick event of a Menu item i set it to a hidden field and on Init of the Master page im not able to access this hidden field value.
Regards
Hi All, Im executing javascript on a master page that is onClick event of a Menu item i set it to a hidden field and on Init of the Master page im not able to access this hidden field value.
Regards
State isn't available in your controls until the Load phase. Before that you have to check in Request.Form
Hi , This is the Code. In the Master Page i add the tag Then i have a script tag which runs a function setScript() that is everytime the Master Page is loaded setScript(); //I Navigate through all the menu items, which is navigate through all the "a" tags and then all of the a tags onclick event i add a new function ,below is the code
setScript();
function setScript()
{
var objMenu=document.getElementById('<%=_menu.ClientID %>');
var objHyperLinks=objMenu.getElementsByTagName('a');
for(var i=0;i<objHyperLinks.length;i++)
{
var pageLoc=objHyperLinks[i].href;
objHyperLinks.item(i).onclick=function (){return setEvent(this);};
}
}
function setEvent(Loc)
{
var pageLoc=Loc+"";
var iframePath=document.location.href;
var targetPath=pageLoc;
document.getElementById('<%=hdnPath.ClientID %>').value=targetPath;
if(document.all)
{
document.all.frameLoader.src=targetPath;
}
else
{
var frame=window.frames;
frame[0].location.href=targetPath;
}
return false;
}
I alert the value of hdnPath right after the targetPath is assigned and i get to see the assigned value.