Master Page and Web User Control Problem

M

mazdotnet

Hi everyone,

I have placed a simple Web User Control (Response.Write("hello")) on
my page which uses a Master Page to test this problem that we have.
Every time I run the web app it displays
the word "hello" at the top of the Master Page. Why is that? Why
doesn't it display it where you want it to display it? Isn't a Web User
Control sort of like place holder?


Example. Default.aspx contains
1
2
3
Reference to my Web User Control to display 'hello'

When I execute it I get
hello
1
2
3
Instead of hello appearing at the end.

Thanks
MA
 
G

Guest

Response.write does display at the top - not sure why - possibly something to
do with compile time.
Try adding label controls to your page, then setting the Label1.Text
property from your code behind. This way you can separate your display from
your code.
Hope this helps
Andy
 
Joined
Jul 20, 2006
Messages
1
Reaction score
0
I would say that the control is a server side process, so it is happening first then the page writes are following it. If you put the control in a panel on the page where you want it I think it will show up where you want it to or do all the work on the server.

Keith
 

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,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top