java script in content page not called remotely
-
Wednesday, August 01, 2012 4:01 PM
Have a jscript file with a function that needs to be called after the user enters the password. the script generates a hash of the password before it is sent to the server.
This works just fine in both the development machine VS 2010 debugger and the server debugger, but not live: the jscript function is ignored.
ASP.Net Web app hosted in IIS, WCF service is self hosted.
There is one special property added to the text box: ClientIDMode="Static". This makes the text box visible to the jscript function.
There is one special property added to the button: onfocusin="encrypt();" followed by Onclick="BtnClick" at the end of the asp:Button definition. This is supposed to cause the function to be called before the button gets focus - but when accessing it remotely, nothing happens.
Both are in cells in a table. I have found lots of ways to call the script when the page loads, but I don't want to execute in until the user has entered the password.
Any ideas will be appreciated.
All Replies
-
Wednesday, August 01, 2012 5:11 PM
Got it - need to tell the Page about the external js files in the Page_Load of the Default.aspx file:
Page.ClientScript.RegisterClientScriptInclude(
"WcfScript.js", "Scripts/WcfScript.js");
Page.ClientScript.RegisterClientScriptInclude(
"sha256.js", "Scripts/sha256.js");and it all works just fine.
- Marked As Answer by roadkill4299 Wednesday, August 01, 2012 5:11 PM
-
Monday, August 06, 2012 8:46 AM
Hi roadkill4299,
Thank you for sharing your solutions here.
Bob Shen [MSFT]
MSDN Community Support | Feedback to us

