Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Master Page and Web User Control Problem

Reply
Thread Tools

Master Page and Web User Control Problem

 
 
mazdotnet
Guest
Posts: n/a
 
      05-24-2006
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5keQ==?=
Guest
Posts: n/a
 
      05-24-2006
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

"mazdotnet" wrote:

> 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
>
>

 
Reply With Quote
 
 
 
 
keith keith is offline
Junior Member
Join Date: Jul 2006
Posts: 1
 
      07-20-2006
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP 2.0: How to access Master Page from Web User Control on Page? ivanpais@gmail.com ASP .Net 5 06-18-2010 08:33 AM
Setting the value of a Master page's control's property using a property of the Master page Nathan Sokalski ASP .Net 25 03-04-2010 03:42 AM
Can a master page be built from another master page Zeba ASP .Net 1 02-22-2007 10:55 AM
accessing the web user control's control from a web page and set a value from another web page Reny J Joseph Thuthikattu ASP .Net 1 12-30-2004 12:21 PM
seeking servlet "Master" keep getting "Master/servlet/Master" not found. Tomcat 5.0.25 Doug McCann Java 1 08-05-2004 09:16 PM



Advertisments