[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Returning a value from an ASCX function

Using ASP.NET 1.1 (VB), is it possible for a container ASPX page to execute a Function within a user control (ASCX.VB)  and capture the returned value?
0
RichardKline
Asked:
RichardKline
1 Solution
 
TSmoothCommented:
Yes, simply define the function in your ascx's vb file as public and then in your aspx page's code behind, obtain a reference to the control and call it's function just like any other function:

Dim ctrl As New MyCustomControl
Page.Controls.Add(ctrl)

Response.Write(ctrl.MyFunction(param1, param2))
0
 
RichardKlineAuthor Commented:
Thanks!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now