473,698 Members | 2,250 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 1885
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
5071
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
1833
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
1841
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
2698
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
14255
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
2877
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
3206
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
866
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
1134
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
8675
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
9029
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...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6521
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
5860
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
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
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
2002
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.