I have an ASCX page in C# for file uploads and an ASPX page that references the ASCX page. I need to reference a variable in the ASCX page that is public. How can I reference that on my ASPX page??
You need to declare a new instance of the ASCX control, and then
you can access its public variable. If youve added the control to
the ASPX page, then a new instance of the control will be created
at runtime automatically, so to get the variable you can just
access it through the ASCX controls name.
If myControl were the ASCX control, then you would use:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.