Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft ASP .NET
Accessing functions in dlls from code behind
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="shaun duke, post: 3860751"] I have been researching this over the last two days without success. I have a number of ultility functions that I want to make available to all pages. The pages will all be using code behind so my plan is to create an assembly CommonFunctions.dll place it in the /bin folder for the application and import the namespace into the code behind where required. Here is an abstract of CommonFunctions.vb Option Strict Off Imports System etc etc etc Namespace CommonFunctions Public Class Functions Inherits Page Public Sub SetFocus(ByVal FocusControl As Control) Dim ClientID As String = FocusControl.ClientID Dim ScriptString as String = "<script language='javascript'>document.getElementById('" & ClientID & "').focus();</script>" RegisterStartupScript("setFocus", ScriptString) End Sub End Class End Namespace This compiles correctly and I have no problem using the SetFocus function from a aspx with no code behind using <%@ import Namespace="CommonFunctions" %> My problem comes when trying to use SetFocus in code behind script. Even though I import the namespace I get the error BC30451: Name 'SetFocus' is not declared. Thanks in advance [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft ASP .NET
Accessing functions in dlls from code behind
Top