Page and User Control Communication
page 6 of 7
by Brian Mains
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 16380/ 243

Web Application Project

With the web application project add-on, all of the pages are compiled into a single assembly, as in the .NET 1.x days. This means that all of the files are compiled to the same assembly, and that the code-behind files can be programmed against. What I mean is the ASP.NET page's class can be potentially used within a user control because the user control and page are not dynamically compiled.

In this model, a custom page class would not need defined in the App_Code folder because all of the code-behind files can be programmed against, making less work than the approach above.  Though, it would be wise to research the differences with Web Application Project applications to ensure it is the right model for you.


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 6 and 5 and type the answer here:

User Comments

Title: Use events   
Name: Sowokie
Date: 7/14/2008 7:39:34 AM
Comment:
At my work we implemented a event system that makes you able to register an event(in one control) and listen for that event (in another control). This way you can also send over objects and use them. And you never have to involve the page. You just drop the controls on what page you like and they know how to talk to each other.

When this has been set up once, using it is extreamly easy. This is something i would like to have by default in the framework..

As a rule we try to use this sparingly but we have never had any speed/memory problems at all with this approach!
Title: Great that approves my way   
Name: Muhammad Mosa
Date: 7/11/2008 12:02:07 PM
Comment:
Great Brain, that actually confirm my way I'm currently using.
I faced the issue that I needed 2 user controls to be able to communicate with each others through the Page. And the way you present here is also good for such cases.
Cheers
Title: Nice Article!   
Name: Ehsan
Date: 7/11/2008 11:05:18 AM
Comment:
This article just opened my eyes up to a lot of possibilities.

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 12/3/2008 11:06:40 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search