S
stephen
Hi,
I have a javascript file that I want to use on a button.
If I have the javascript file in the same folder as the webform then it
works for eg:
/SampleApp/WebForms/TestForm.aspx
but I want to try to read the javascript from another folder for e.g
/SampleApp/JScript/MyJavaScript.js
Here is my code:
if (!Page.IsClientScriptBlockRegistered("TestJavaScript"))
{
Page.RegisterClientScriptBlock("TestJavaScript", "<script
Language='JavaScript' src='MyJavaScriptFile.js'></script>");
"I want to change it to ---- src='~/JScript/MyJavaScriptFile.js'
}
btnRegisterClientScriptBlockJS.Attributes.Add("onclick",
"ConfirmationWindow();");
It does not work if i change it to second option...
any advice.
Thanks,
Stephen
I have a javascript file that I want to use on a button.
If I have the javascript file in the same folder as the webform then it
works for eg:
/SampleApp/WebForms/TestForm.aspx
but I want to try to read the javascript from another folder for e.g
/SampleApp/JScript/MyJavaScript.js
Here is my code:
if (!Page.IsClientScriptBlockRegistered("TestJavaScript"))
{
Page.RegisterClientScriptBlock("TestJavaScript", "<script
Language='JavaScript' src='MyJavaScriptFile.js'></script>");
"I want to change it to ---- src='~/JScript/MyJavaScriptFile.js'
}
btnRegisterClientScriptBlockJS.Attributes.Add("onclick",
"ConfirmationWindow();");
It does not work if i change it to second option...
any advice.
Thanks,
Stephen