Jump to content

call javascript function of .js file in behind code of an user control .ascx file


sheryi26

Recommended Posts

Hi, I have a javascript function, its name is "MD5(string str)" inside of a ".js" file as "encryption.js"I want to call this function in the behind code of .ascx(the user control)file, but I can't and its error said "The name MD5 does not exist in the current context" I know and I had tried many solutions, but they were not correct!I appreciate any help for my problem...txtPasswordHash.Text = MD5(txtPassword.Text);.. .

Link to comment
Share on other sites

It is because JavaScript does not support hashing.There IS a valid hashing technique though. Download this file, and extract them to a valid directory in your website or webserver.Then write a script like this:

<script type="text/javascript" src="md5-min file path"></script><script type="text/javascript">function y(str){var x=hex_md5(str);// What you want to do with the hash...}</script>

It should work perfect.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...