How to place my user controls in a webpage

A

ALI-R

Hi I've created a bunch user comtrols for the footer,header,navigation bar
of a webpage ,I have two problems:


1) All the controls are in the folder "Control" of the root and all the
images are in the folder "Images" of the root ,all the hosting pages for my
user controls are also in the root,what kind of path should I use for images
in my user control? absolute,relative,..?


2)should I create a table in the hosting page and place user controls in it?
I like to my page shows everthing in the middle of the page no matter wether
user maximizes the window or resizes that,so what kind of alignment should I
consider for the hosting table or my user controls which are in tables too?

Thanks
 
O

Ollie Riches

See inline comments

HTH

Ollie Riches
ALI-R said:
Hi I've created a bunch user comtrols for the footer,header,navigation bar
of a webpage ,I have two problems:


1) All the controls are in the folder "Control" of the root and all the
images are in the folder "Images" of the root ,all the hosting pages for my
user controls are also in the root,what kind of path should I use for images
in my user control? absolute,relative,..?

You can drag the user control onto the page in the visual studio it will
automatically add the references required to the aspx page.

You should always use relative paths where possible, so if you have an image
directory under your root directory you would access it in an asp.net page
like

2)should I create a table in the hosting page and place user controls in it?
I like to my page shows everthing in the middle of the page no matter wether
user maximizes the window or resizes that,so what kind of alignment should I
consider for the hosting table or my user controls which are in tables
too?

You can place user control directly into a HTML table or you could host
(contain) them inside an asp.net PlaceHolder or Panel the decision is up to
you

for the alignment you want to do this in the HTML of the page no the code
behind, if you want the content of the page to appear in the middle make
sure that the align attrbute on the HTML table is set to 'center' e.g.

<body>
<form id="myForm" method="post" runat="server">
<table width="200" height="400" align="center">
</table>
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top