BusinessRx Community

Dedicated to the advancement of software, technology and the people who devote their lives to it.

Welcome to BusinessRx Community Sign in | Join | Help
in Search

BusinessRx Reading List

These blog entries are written by industry experts and leaders. We consider this content to be a good read for any software developer or web technologist.

Passing Information Between Master Pages and Content Pages

I teach two ASP.NET classes through the Extension program at the University of California - San Diego, and one of the most common questions I am asked regarding Master Pages is, “How do I pass information from my Master Page to its content page (or vice-a-versa)?”

For example, in the ASP.NET Programming II class, students create a custom site map provider whose structure is based upon the data in the database. The Master Page contains navigation controls (a TreeView, perhaps, or a Menu) that uses this custom site map provider. The challenge is on administrative pages, where an admin might add, update, or delete the corresponding database data, the Master Page's navigation is rendered before the content page executes its database command to modify the site map structure. Consequently, the page's navigation is not up-to-date immediately after modifying the site map structure (although it picks up the changes on the next postback). This can be remedied by having the content page tell the Master Page, “Hey, you there! I just updated the site map data, so go ahead and rebind the site map data to your TreeView.“

This begs the question, How do you get the content page and Master Page talking? To address this question, I wrote up an article discussing different techniques: Passing Information Between Content and Master Pages.

Published Tuesday, January 30, 2007 7:21 AM by Scott on Writing

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server, by Telligent Systems
'