473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to call code in aspx webform from functions defined in code behind modules

CW
I find it necessary to mix code-behind and non-code behind techniques
sometimes.

I have utility functions defined in a VB module. Is there anyway for me to
call functions defined in VB module from aspx form (i.e., code mixed in with
html elements) or even call public shared functions from other code behind
classes)?
Nov 18 '05 #1
3 3717
<%=FunctionName%> in the HTML will call your code-behind function, which
must be defined as Protected.

"CW" <a> wrote in message news:OU**************@TK2MSFTNGP12.phx.gbl...
I find it necessary to mix code-behind and non-code behind techniques
sometimes.

I have utility functions defined in a VB module. Is there anyway for me to
call functions defined in VB module from aspx form (i.e., code mixed in with html elements) or even call public shared functions from other code behind
classes)?

Nov 18 '05 #2
CW
Thanks for the help

"Rick Spiewak" <ri*********@mindspring.com> wrote in message
news:O2*************@TK2MSFTNGP09.phx.gbl...
<%=FunctionName%> in the HTML will call your code-behind function, which
must be defined as Protected.

"CW" <a> wrote in message news:OU**************@TK2MSFTNGP12.phx.gbl...
I find it necessary to mix code-behind and non-code behind techniques
sometimes.

I have utility functions defined in a VB module. Is there anyway for me to call functions defined in VB module from aspx form (i.e., code mixed in

with
html elements) or even call public shared functions from other code behind classes)?


Nov 18 '05 #3
You can access code from code modules, however you must declare the
Module Public and you must qualify the call with the proper namespace.
For example:

in you module:

Public Module Module1
Public Function getString() As String
Return "from module"
End Function
End Module

in your call:

<%=VBTest.Module1.getString()%>

where VBTest is the name of the project or parent namespace of
Module1.

hope this helps,

John
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Tim ffitch | last post by:
Hi I have created a VB dll file that contains common functions I use across various projects in VB, Access and Excel. Rather than have to code the functions in each I decided to use the dll...
2
by: adiel | last post by:
Hello, I am trying to access the properties and methods from a user control within the code-behind file for a webform but I am receiving the message: Name 'MenuBar1' is not declared It does...
1
by: timmso | last post by:
If I create a webform in notepad (save it with an .aspx extension), I can see the VB.Net code along with the ASP.Net code in one file. If I create an Asp.Net web application and add a web form...
2
by: Technical Support | last post by:
Good afternoon, I created a custom control, compiled it into a DLL, and added it to the BIN directory. I placed an instance of the control in a webForm and am trying to programatically change its...
6
by: grist2mill | last post by:
I want to create a standard tool bar that appears on all pages that is a control. The toolbar has a button 'New'. What I wolud like when the user clicks on 'New' depends on the page they are on. I...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
4
by: qualitynice | last post by:
HELP :-)... I'm creating an embedded activex object in an asp.net page using the HtmlGenericControl class. I'm doing this because when I tried to embed it directly in the aspx page, it stopped...
4
by: Michael | last post by:
Hi When I New a web site, the default coding model is code-separation. I can uncheck the "place code in separate file" checkbox when I add a new WebForm, and VS2005 will remember this setting. ...
11
by: Yelena Varshal via AccessMonster.com | last post by:
Hello, I have a problem with one of msaccess.exe API calls that work on my desctop but does not work on the laptop from within MS ACCESS. There is a lot of differences between 2 computers...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.