Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get controls from another page 1

Status
Not open for further replies.

zzfive03

Programmer
Jun 11, 2001
267
0
0
I have been researching this forever and can not figure it out..

I have page1.aspx and page2.aspx

Page 2 has some text box controls on it, and i have created public properties to access thoes controls.

What I want to do, is have page 1 get access the object of page 2, and loop the public properties, to get a list of the controls from page 2.

I can not seem to figure out how to properly get a handel on page 2 from page 1. I have even placed them in the same namespace, they just cant seem to see eachother.

Any ideas?

 
What is it you are actually trying to do? What would you do with these control if you did get a reference to them?


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
The idea is this:

Page1 would be an admin page, from which, you have a pulldown of each page on the web site (hard coded list).

When you select a page, i want to have a list of all controls for that page dynamicly load, with ENABLE and VISIBLE checkboxes next to them. There by , allowing an admin to select which to show and enable. This will write to an XML seucurity file, which is then read by page2 (or all pages) to determine which controls to show or not.

The XML part already works, i just thought it would be neat to have an admin page that could dynamicly load all of the controls for each page w/o me having to do anything special when i add/remove controls from my web pages.

Mark
 
The issue I am having is I cant seem to get a handel on the Page2 object from Page1.

Though they are both in the same namespace...

PAGE1.CS:
namespace Pages
{
public partial class demo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}

PAGE2.CS
namespace Pages
{
public partial class home : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}

In either page, I can do a "Pages.", but only get its own self, i dont reslove the other page. Hum...
 
That is because each page is compiled to it's own assembly. If you want to reference another page, you will have to a reference directive e.g.
Code:
<<%@ Reference Page="~/mysecondpage.aspx" %>


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top