By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,586 Members | 623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,586 IT Pros & Developers. It's quick & easy.

Add Module to ASP.NET site

P: n/a
les
Hello,

I get the error on refering to the function created in the module. I've
tried to declare the module but it is not halping. Please let me know what
I'm doing wrong.

This is my declaration in the ASPX file:
----------------------------------------------------------------------------
------------------------------
'reference to the function
HashData("teststring")
----------------------------------------------------------------------------
------------------------------

This the error that I get on the page:
----------------------------------------------------------------------------
------------------------------
Compiler Error Message: BC30451: Name 'HashData' is not declared.
----------------------------------------------------------------------------
------------------------------

This is my module: modEncrypt.vb
----------------------------------------------------------------------------
------------------------------
Imports System.Text

Imports System.Security.Cryptography

Module modEncrypt

Public Function HashData(ByVal s As String) As String

'Convert the string to a byte array

Dim bytDataToHash As Byte() = (New
UnicodeEncoding()).GetBytes(s)

'Compute the MD5 hash algorithm

Dim bytHashValue As Byte() = New
MD5CryptoServiceProvider().ComputeHash(bytDataToHa sh)

Return BitConverter.ToString(bytHashValue)

End Function

End Module

----------------------------------------------------------------------------
------------------------------

Anyhelp is greatly appreciated,
Les

Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
les
Yes,

I've got the same error:

Compiler Error Message: BC30451: Name 'modEncrypt' is not declared.
les

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:Op**************@TK2MSFTNGP09.phx.gbl...
Did you try modEncrypt.HashData?

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"les" <bennettdotdill@no_spamburke.com> wrote in message
news:eG******************@news20.bellglobal.com...
Hello,

I get the error on refering to the function created in the module. I've
tried to declare the module but it is not halping. Please let me know what I'm doing wrong.

This is my declaration in the ASPX file:


--------------------------------------------------------------------------
--
------------------------------
'reference to the function
HashData("teststring")


--------------------------------------------------------------------------
--
------------------------------

This the error that I get on the page:


--------------------------------------------------------------------------
--
------------------------------
Compiler Error Message: BC30451: Name 'HashData' is not declared.


--------------------------------------------------------------------------
--
------------------------------

This is my module: modEncrypt.vb


--------------------------------------------------------------------------
--
------------------------------
Imports System.Text

Imports System.Security.Cryptography

Module modEncrypt

Public Function HashData(ByVal s As String) As String

'Convert the string to a byte array

Dim bytDataToHash As Byte() = (New
UnicodeEncoding()).GetBytes(s)

'Compute the MD5 hash algorithm

Dim bytHashValue As Byte() = New
MD5CryptoServiceProvider().ComputeHash(bytDataToHa sh)

Return BitConverter.ToString(bytHashValue)

End Function

End Module


--------------------------------------------------------------------------
--
------------------------------

Anyhelp is greatly appreciated,
Les


Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.