473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Web user controls

Ben
Hi, I would like to use web user contols for header and footer controls.
The problem I'm having is that we're using tables for layout. (thanks for
any pro css solutions, but thats' a different thread :))

So in the header I want to output say..

<table><tr><td><script src="foo.js"></script></td><td>

Only if the page requires the menu, otherwise, none of that html should be
sent... I can set the property to determine if the data should be sent,
but i'm using response.write, that's putting the html at the top of the
page. :( How can I specify where in the user control to send the html?

Someone suggested adding a literal control, but would that add the </table>
also? I really want my content in the page and the </table> in the footer
control. Also, is it possible to have the user control add a stylesheet to
the page?

TIA,
Ben

Nov 18 '05 #1
1 1045
First of all, placing all page content in one single table is just not a
good idea, in my opinion. This requires that browser generates the
whole table before rendering it ... which will give an impression of
slower page load, especially when you nest more tables in your layout,
or clients are old and slow.

You could easily create a 3 table layout. One for header, one of
content and the final one for footer. This way, you can easily manage
the header by placing markup it it's own control and display it or hide
it using <control>.Visible property, for instance.

You could use the literal control, sure. Just write the HTML code you
want to it ... ugly, but it should work.

You could also convert the table or it's elements into server side
controls and control visibility on the server side. For instance:

<table><tr id="MenuRow" runat="server"><td><script
src="foo.js"></script></td></tr>

Then on your prerender event, set MenuRow.Visibile = false

I'm not really sure what you are trying to accomplish here ... there are
a number of ways to write a piece of HTML to a particular spot on the
page. It would help to see the actual table layout and some of it's key
contents. However, if you must use tables for layout, don't use just
one ...

And you can certainly use a control to add a stylesheet to a page.

ib.

Ben wrote:
Hi, I would like to use web user contols for header and footer controls.
The problem I'm having is that we're using tables for layout. (thanks for
any pro css solutions, but thats' a different thread :))

So in the header I want to output say..

<table><tr><td><script src="foo.js"></script></td><td>

Only if the page requires the menu, otherwise, none of that html should be
sent... I can set the property to determine if the data should be sent,
but i'm using response.write, that's putting the html at the top of the
page. :( How can I specify where in the user control to send the html?

Someone suggested adding a literal control, but would that add the </table>
also? I really want my content in the page and the </table> in the footer
control. Also, is it possible to have the user control add a stylesheet to
the page?

TIA,
Ben

Nov 18 '05 #2

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

Similar topics

1
by: Robert Howells | last post by:
Perhaps I'm just too new at this to pull it off, or perhaps it's just bad architecture. I'd appreciate some feedback on the the wisdom (or lack thereof) in attempting the following: I'm not new...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
4
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
2
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
3
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
1
by: Demetri | last post by:
I'm trying to determine if we want to use panels or user controls for our pages. Our primary concern is performance, page loading and posting speed. To illustrate my question, lets use the...
8
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem...
3
by: Terry Olsen | last post by:
I'm trying to add a domain user to a local group using the code below: Dim LCL As New DirectoryEntry("WinNT://" + Environment.MachineName + ",computer") Dim DOM As New...
1
by: zeya_bakhtyar | last post by:
Here is the page architecture: Page loads multiple user controls (including nested user controls) dynamically based on parameters provided into place holders. Note: The page only has the logic to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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...
0
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...

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.