How to reference a page

  • Thread starter Thread starter DC Gringo
  • Start date Start date
D

DC Gringo

I have a user control that is reused in 5 .aspx pages and references a
variable called "theSection" which is set in the class for each .aspx page.
If I only had one .aspx page, I would reference the variable "theSection"
like this.

myAspx1.theSection

How do I reference the selected .aspx page--any of which have the user
control within--as a variable so I don't have to you conditionals?

<aspxPageVariable>.theSection
 
DC,

I am not sure about your question, however probably the answer is
me.theSection

I hope this helps?

Cor
 
Use the Page property of the user control. You will have to typecast this
property to a specific page type to get theSection . Also, theSection should
be public on all containing pages.

Eg:

From the ascx page, CType(Me.Page, <parent_page_class>).theSection

HTH.


I have a user control that is reused in 5 .aspx pages and references a
variable called "theSection" which is set in the class for each .aspx page.
If I only had one .aspx page, I would reference the variable "theSection"
like this.

myAspx1.theSection

How do I reference the selected .aspx page--any of which have the user
control within--as a variable so I don't have to you conditionals?

<aspxPageVariable>.theSection
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top