473,385 Members | 1,331 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,385 software developers and data experts.

Masterpages and Response.Write prblem

Hi

I have a page based on a masterpage:

when i use Response.Write then the markup appears in the masterpage content
location and not in the content of the page itself
(not in the location of the contentplaceholder of the masterpage.)

Any workaround ?

Johan
Feb 5 '08 #1
4 4899
Use a placeholder or a label control to control were this content is
placed...

This is not specific to masterpage. The whole idea of ASP.NET is to have a
server side programming model you work with that will then render the HTML
markup once all is ready. Using Response.Write interferes with this
principle....

--
Patrice

"Sagaert Johan" <RE*************@hotmail.coma écrit dans le message de
news: uO****************@TK2MSFTNGP04.phx.gbl...
Hi

I have a page based on a masterpage:

when i use Response.Write then the markup appears in the masterpage
content location and not in the content of the page itself
(not in the location of the contentplaceholder of the masterpage.)

Any workaround ?

Johan

Feb 5 '08 #2
"Sagaert Johan" <RE*************@hotmail.comwrote in message
news:uO****************@TK2MSFTNGP04.phx.gbl...
I have a page based on a masterpage:

When i use Response.Write then the markup appears in the masterpage
content location and not in the content of the page itself
(not in the location of the contentplaceholder of the masterpage.)

Any workaround ?
As Patrice mentioned, try to avoid Response.Write in ASP.NET if you possibly
can - in almost every situation, it's the wrong solution...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Feb 5 '08 #3
Move your Response.Write to OnRender event

George.

"Sagaert Johan" <RE*************@hotmail.comwrote in message
news:uO****************@TK2MSFTNGP04.phx.gbl...
Hi

I have a page based on a masterpage:

when i use Response.Write then the markup appears in the masterpage
content location and not in the content of the page itself
(not in the location of the contentplaceholder of the masterpage.)

Any workaround ?

Johan

Feb 5 '08 #4
Thanks

I already had a feeling of being busy at a too low level
"Patrice" <http://www.chez.com/scribe/wrote in message
news:uq****************@TK2MSFTNGP03.phx.gbl...
Use a placeholder or a label control to control were this content is
placed...

This is not specific to masterpage. The whole idea of ASP.NET is to have a
server side programming model you work with that will then render the HTML
markup once all is ready. Using Response.Write interferes with this
principle....

--
Patrice

"Sagaert Johan" <RE*************@hotmail.coma écrit dans le message de
news: uO****************@TK2MSFTNGP04.phx.gbl...
>Hi

I have a page based on a masterpage:

when i use Response.Write then the markup appears in the masterpage
content location and not in the content of the page itself
(not in the location of the contentplaceholder of the masterpage.)

Any workaround ?

Johan


Feb 5 '08 #5

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

Similar topics

3
by: Lars W. Andersen | last post by:
Hi, I am looking for a good - easy to comprehend little CMS application for my "beginners" asp.net 2.0 site. It must be able to use Access as the database (only a couple of people will be...
2
by: iturner100 | last post by:
Hi, I've been struggling with this one for a couple of hours without much joy. Basically, I've got a set of nested masterpages (3 as it happens). I'm dynamically generating a new page in code...
5
by: Nick Wouters | last post by:
Dear All In Classic ASP I used CSS for ALL layout. Now in ASP.NET version 2 I am testing out Masterpages as they come in very handy. It seems like it is replacing CSS for layout but what is...
2
by: encoad | last post by:
Hi everyone, I'm slowly going mad with Masterpages and the FindControl. After a couple days of figuring out how to use the FindControl command from within a Masterpage, I still can't explain...
4
by: Mark Rae | last post by:
Hi, I have a site which uses dynamic MasterPages. The selection of the MasterPage to use is determined by an encrypted QueryString. Session_Start looks for the presence of the QueryString,...
1
by: needin4mation | last post by:
I have this code. The preinit never fires: public partial class MasterPage : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Label1.Text...
1
by: Steve | last post by:
After a few hours of trial and error I have reached the following conclusions, can you please tell me if I am right: I have 2 aspx pages both with the same master page and I wish to pass values...
6
by: =?Utf-8?B?U3RlcGhlbiBIYXRmaWVsZA==?= | last post by:
I have two masterpages in a web application. One is used for the login and logout pages. The other is used for all other pages in the application. The difference between the two masterpages is...
8
by: Mort Strom | last post by:
Right now the header of my master page contains all of the CSS styles for all of the pages that might be loaded in my ContentPlaceHolder. The problem is that my <styletag is getting too large to...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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...

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.