473,729 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I have "common controls" for every page?

I have a set of pages ( about 10 ) that all have the same controls at
the top, however I am unable to put the controls the master page for
the site since the other 50 pages dont have the controls.

Is there a way that I can define a common template / etc where this
code can live 1 place and then I can just use it / insert it onto
these ten pages?

So for example if you wanted to put 4 text boxes on 10 pages with the
4 text boxes exactly the same... can I get away just cut/paste the 4
text boxes?

Basically a base class for the aspx page is what I am looking for..
sort of?

-Jeff

Jul 13 '07 #1
4 1890
You can have more than 1 master page.

Just create a master page which has those controls,
and specify *that* master page in the 10 pages in question.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
<jm******@gmail .comwrote in message news:11******** **************@ j4g2000prf.goog legroups.com...
>I have a set of pages ( about 10 ) that all have the same controls at
the top, however I am unable to put the controls the master page for
the site since the other 50 pages dont have the controls.

Is there a way that I can define a common template / etc where this
code can live 1 place and then I can just use it / insert it onto
these ten pages?

So for example if you wanted to put 4 text boxes on 10 pages with the
4 text boxes exactly the same... can I get away just cut/paste the 4
text boxes?

Basically a base class for the aspx page is what I am looking for..
sort of?

-Jeff

Jul 13 '07 #2
On Jul 13, 4:04 pm, "Juan T. Llibre" <nomailrepl...@ nowhere.com>
wrote:
You can have more than 1 master page.

Just create a master page which has those controls,
and specify *that* master page in the 10 pages in question.

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en español :http://asp.net.do/foros/
=============== =============== ========

<jmacd...@gmail .comwrote in messagenews:11* *************** ******@j4g2000p rf.googlegroups .com...
I have a set of pages ( about 10 ) that all have the same controls at
the top, however I am unable to put the controls the master page for
the site since the other 50 pages dont have the controls.
Is there a way that I can define a common template / etc where this
code can live 1 place and then I can just use it / insert it onto
these ten pages?
So for example if you wanted to put 4 text boxes on 10 pages with the
4 text boxes exactly the same... can I get away just cut/paste the 4
text boxes?
Basically a base class for the aspx page is what I am looking for..
sort of?
-Jeff
Hmm. .that might help... Quick question how would I get access to the
middle master page ( this new one ) custom controls from the code
behind of the individual asp pages? For example I cant just do
"this.textb ox1" can I ?

Jeff

Jul 13 '07 #3
re:
!Quick question how would I get access to the middle master page ( this new one )
!custom controls from the code behind of the individual asp pages?
!For example I cant just do "this.textb ox1" can I ?

No, you can't.

Check out "To reference a control on the master page" sample code in this article:

http://msdn2.microsoft.com/en-us/library/xxwa0ff0.aspx


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
<jm******@gmail .comwrote in message news:11******** **************@ e9g2000prf.goog legroups.com...
On Jul 13, 4:04 pm, "Juan T. Llibre" <nomailrepl...@ nowhere.com>
wrote:
You can have more than 1 master page.

Just create a master page which has those controls,
and specify *that* master page in the 10 pages in question.

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en español :http://asp.net.do/foros/
=============== =============== ========

<jmacd...@gmail .comwrote in messagenews:11* *************** ******@j4g2000p rf.googlegroups .com...
I have a set of pages ( about 10 ) that all have the same controls at
the top, however I am unable to put the controls the master page for
the site since the other 50 pages dont have the controls.
Is there a way that I can define a common template / etc where this
code can live 1 place and then I can just use it / insert it onto
these ten pages?
So for example if you wanted to put 4 text boxes on 10 pages with the
4 text boxes exactly the same... can I get away just cut/paste the 4
text boxes?
Basically a base class for the aspx page is what I am looking for..
sort of?
-Jeff
Hmm. .that might help... Quick question how would I get access to the
middle master page ( this new one ) custom controls from the code
behind of the individual asp pages? For example I cant just do
"this.textb ox1" can I ?

Jeff
Jul 14 '07 #4
In article <OW************ **@TK2MSFTNGP02 .phx.gbl>, Juan T. Llibre
<no***********@ nowhere.comwrit es
>You can have more than 1 master page.

Just create a master page which has those controls,
and specify *that* master page in the 10 pages in question.
Even better (if I may say so) might be to have the master page for these
10 pages be a child of the main master page. That way you get the
consistency of the main master page with the extra bits for these 10
pages, and you don't need to duplicate any code.

In other words, all pages on the site use Master1.master, but these 10
pages use Master2.master, which itself has Master1.master as its own
master.

Sorry Juan if this is what you meant, but it sounded like you were
suggesting having an entirely separate master page for these 10 pages,
rather than a nested master page. A separate one would lead to duplicate
code, with all the inherent problems that would cause.
>Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
============== =============== =========
<jm******@gmai l.comwrote in message
news:11******* *************** @j4g2000prf.goo glegroups.com.. .
>>I have a set of pages ( about 10 ) that all have the same controls at
the top, however I am unable to put the controls the master page for
the site since the other 50 pages dont have the controls.

Is there a way that I can define a common template / etc where this
code can live 1 place and then I can just use it / insert it onto
these ten pages?

So for example if you wanted to put 4 text boxes on 10 pages with the
4 text boxes exactly the same... can I get away just cut/paste the 4
text boxes?

Basically a base class for the aspx page is what I am looking for..
sort of?

-Jeff

--
Alan Silver
(anything added below this line is nothing to do with me)
Jul 18 '07 #5

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

Similar topics

7
5075
by: Sherry Littletree | last post by:
Hi All I am working on a site that has a large amount of common html on all its web pages. I am looking for a way to place this in a single file so, if changes are made, I can change this single file and do not have to change each and every page. I have the Java scripting in a common .Js file but have not been able to find a way to do this with my html content.
4
1841
by: babylon | last post by:
I created a class which inherits from UserControl.. However, I can't find it in the "My User Controls" tab in designer view... How can i add it back myself? thx...
0
1845
by: Klemens | last post by:
what do entry's like this in db2diag.log indicate? ------------------------------------------- 2004-01-14-09.07.52.650000 Instance:WWS Node:000 PID:3512(db2syscs.exe) TID:1116 Appid:*LOCAL.WWS.01AFC9110326 data protection sqlpALR_OpenExtent Probe:5 Database:XTRADE RenameArray: add unarchived log 1227. 2004-01-14-09.07.52.947000 Instance:WWS Node:000 PID:3512(db2syscs.exe) TID:1116 Appid:*LOCAL.WWS.01AFC9110326
10
2701
by: BBM | last post by:
Hi, I have been developing with C# User Controls and occasionally have a problem where I "lose" a control from the design surface of the User Control. The controls that I am using to build my User Controls are themselves custom controls. Occasionally, when I change something in either the User Control and/or one of the custom controls that are on it and recompile, when I go to the "Visual" design surface of the User Control, the...
1
14260
by: VMI | last post by:
Im using a separate thread in my code to copy a huge file, but I get the "Controls created on one thread cannot be parented to a control on a different thread" when I want to update the Form controls after makeBackup is complete. I know what the problem is (I'm trying to update controls from a thread that did not create them), but how can I fix it? This my code: private delegate void BackupCompletedEventHandler(); private event...
2
2878
by: crjunk | last post by:
I'm trying to write a piece of code that will programatically save a record automatically without me having to add a new ' Row.Item("ADD1") = txtAdd1.Text.Trim.ToUpper ' type command each time I add a new textbox. I've named all my textboxes in the following format txtAdd1 and I've named all my field in the SQL table the same way minus the txt at the beginning. This code scans the form for textboxes. If it finds a text box that is not...
5
3209
by: Jim Carlock | last post by:
I've set up the following using an Alias in Apache... Alias /phpdocs/ "C:/Apache/htdocs/common/docs/php/" <Directory "C:/Apache/htdocs/common/docs/php"> Options Indexes FollowSymlinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
0
870
by: Markus Rytterkull | last post by:
Hi! Is it possible to control where controls that are not visible (datasource etc) are positioned in design view? I'm using masterpages with two contentplaceholdes (they alone make the page almost unreadable) and when adding a datasourcecontrol which places it self in the upper lefter corner of my page, it is very difficult to see my other form fields. Is there any setting controlling this so that non-visible controls are
1
1137
by: Munawar Hussain | last post by:
Hi, I was wondering if It is possible to have common viewstate for more than one page? Thanks, Munawar
0
8761
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
9426
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
9281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8148
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...
0
6022
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
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
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
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.