can we use the javascript coding inside the derieved page of masterpage.

Posted by Vanchi050585 under JavaScript on 7/26/2010 | Views : 1547 | Status : [Member] | Replies : 2
hi friends,

can we use the javascript coding inside the derieved page of masterpage. if yes, where i write the script coding like
<script language="javascript" type="text/javascript">
function()
...
...
</script>

please tell me.

i am using but javascript does not work

pls help

Thanks
tvn



Responses

Posted by: BangaruBabu on: 7/26/2010 [Member] Starter

Up
0
Down
Yes We Can Use

In Between Content PlaceHolder Write The Code as Follows

<script language="javascript" type="text/javascript">

function Valid()
{
if(document.getElementById("<%=ddlYear1.ClientID%>").value=="--Year--")
{
alert('Please Select Year');
document.getElementById("<%=ddlYear1.ClientID %>").focus();
return false;
}
else if(document.getElementById("<%=ddlMon1.ClientID%>").selectedIndex==0)
{
alert('Please Select Month');
document.getElementById("<%=ddlMon1.ClientID %>").focus();
return false;
}
}
</script>



Under Page Load Place this piece Of Code

  btnEmpProcessPayRoll.Attributes.Add("onclick", "javascript: return Valid();");


BangaruBabu Pureti
http://bangarubabupureti.spaces.live.com/

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeks on: 7/26/2010 [Member] Bronze

Up
0
Down
Yes you can use the JavaScript in the Child page.

You can even use the JavaScript file in the Derived page.

For example you can write the code to get the JQuery file in master page but you can use the Functions in child page

Thanks,

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response