473,790 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VS2005 Masterpages - predefine controls inside ContentPlaceHol der?

Hello,
I want to define a MasterPage which already has some asp:Textbox and other
controls defined inside a ContentPlaceHol der. 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 ContentPlaceHol der. 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
Nov 19 '05 #1
2 1466
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sat, 4 Jun 2005 19:57:23 +0200, "Urs Eichmann" <xx*@yyy.com> wrote:
Hello,
I want to define a MasterPage which already has some asp:Textbox and other
controls defined inside a ContentPlaceHol der. 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 ContentPlaceHol der. 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


Nov 19 '05 #2
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

"Scott Allen" wrote:
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sat, 4 Jun 2005 19:57:23 +0200, "Urs Eichmann" <xx*@yyy.com> wrote:
Hello,
I want to define a MasterPage which already has some asp:Textbox and other
controls defined inside a ContentPlaceHol der. 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 ContentPlaceHol der. 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


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1781
by: Lars W. Andersen | last post by:
Hi, I am looking for a good - easy to comprehend little CMS application for my "beginners" asp.net 2.0 site. It must be able to use Access as the database (only a couple of people will be posting and editing news articles). I use masterpages so it needs to be able to publish content in the ContentPlaceholder server controls.
2
2467
by: iturner100 | last post by:
Hi, I've been struggling with this one for a couple of hours without much joy. Basically, I've got a set of nested masterpages (3 as it happens). I'm dynamically generating a new page in code and want to be able to populate the ContentPlaceholders of the inner-most masterpage at run-time.
2
2061
by: Rob Dob | last post by:
Hi, How do I go about installing another Web Site Project inside my existing VS2005 website project. I currently have both a forum WSP and my main WSP application within the same solution. Both compile and run without error. However they are separate applications and I would like to have them together in order to make use of my masterpages, and share controls between. Do I need to combine the web.config files? I figured I would just...
1
1310
by: tool | last post by:
Hi all, I Followed these steps : 1. Added a .master file with 3 contentplaceholder controls. 2. Added an aspx file with the @Page directive parameter 'MasterPageFile' set to my .master file. 3. Added an asp:Content in the page. intellisense in my .aspx file worked and the application ran and
2
8296
by: encoad | last post by:
Hi everyone, I'm slowly going mad with Masterpages and the FindControl. After a couple days of figuring out how to use the FindControl command from within a Masterpage, I still can't explain why this code does not function. As you can see if you compile it with 2005, clicking "Button" will achieve the desired result of displaying the contents of the textbox, however the test(); function called from Page_Load does not do anything. ...
6
1983
by: =?Utf-8?B?U3RlcGhlbiBIYXRmaWVsZA==?= | last post by:
I have two masterpages in a web application. One is used for the login and logout pages. The other is used for all other pages in the application. The difference between the two masterpages is that on the main one I have a user control in the left side that has the site navigation menu while the login/logout masterpage has a non-breaking space in that table cell. Everything else is exactly the same. The issue is that the login/logout...
8
2094
by: Randy Smith | last post by:
Hi, I now need to add MasterPages to a number of existing forms, but when I add the code for MasterPage, the MasterPage does NOT appear when it runs. Any thoughts? TIA, Randy Smith
0
1010
by: Vinit | last post by:
Hello All, I am designing the masterpage for my application. The main drawback I observed that it does not resize ifself according to screen size but according to content. I have to write a javascript for content size adjustment. I am adjusting increase or decrease the size of contentplaceholder at runtime.
8
11793
by: Mort Strom | last post by:
Right now the header of my master page contains all of the CSS styles for all of the pages that might be loaded in my ContentPlaceHolder. The problem is that my <styletag is getting too large to manage. I have 300 lines of styles in my masterpage and I don't need all of this for every page -- somehow this can't be a smart way of managing styles. How do I programmatically apply styles in my MasterPage based on the ContentPlaceHolder...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10413
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.