Master Page and Web User Control Problem

  • Thread starter Thread starter mazdotnet
  • Start date Start date
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
 
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
 

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

Back
Top