if(!Page.IsPostBack)
{
if(!Page.IsClientScriptBlockRegistered("MyScript") )
{
Page.RegisterClientScriptBlock("MyScript","<SCRIPT Language='JavaScript' src='MyJavaScriptFile.js'></SCRIPT>");
}
Button1.Attributes.Add("onclick","PopWindow();");
}
Let's take a lot at a simple .js file:
function PopWindow()
{
alert('hello world from the Javascript file');
}
{
if(!Page.IsClientScriptBlockRegistered("MyScript") )
{
Page.RegisterClientScriptBlock("MyScript","<SCRIPT Language='JavaScript' src='MyJavaScriptFile.js'></SCRIPT>");
}
Button1.Attributes.Add("onclick","PopWindow();");
}
Let's take a lot at a simple .js file:
function PopWindow()
{
alert('hello world from the Javascript file');
}