VS2005 Masterpages - predefine controls inside ContentPlaceHolder?

  • Thread starter Thread starter Urs Eichmann
  • Start date Start date
U

Urs Eichmann

Hello,
I want to define a MasterPage which already has some asp:Textbox and other
controls defined inside a ContentPlaceHolder. The idea is that the user of
the master page just changes two or three properties of these "predefined"
controls and has everything right in place. I realize I could program an
ASCX or Webcontrol instead and let the users put that on the page
themselves. But I would prefer if it was already predefined in the master
page, because the controls would be in the right place already.

It seems like I cannot put any constrols inside a ContentPlaceHolder. What
else could I do to achieve my desired result, in a way it is as easy and
fool-proof as possible? Note that the users work with VWD 2005, so I cannot
use Enterpise Templates or such.

Thanks for any ideas,
Urs
 
Is there a way you can place those TextBox controls in the master page
itself?

Then you could expose the TextBox controls as properties of the master
page, and in the Page_Load for the aspx web form the programmer could
just grab a reference to the master page (this.Master or Me.Master),
cast it to the actual type of the master page, and set some properties
via the TextBox properties the master page exposes.
 
How do you "cast it to the actual type of the master page"? Could you please
provide an example? I've tried to make a public property of a textbox on the
master page and read the value from a content page, but I'm baffled!
Thanks much,
David
 

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