473,756 Members | 8,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 contentplacehol der of the masterpage.)

Any workaround ?

Johan
Feb 5 '08 #1
4 4921
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************* ***@TK2MSFTNGP0 4.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 contentplacehol der of the masterpage.)

Any workaround ?

Johan

Feb 5 '08 #2
"Sagaert Johan" <RE************ *@hotmail.comwr ote in message
news:uO******** ********@TK2MSF TNGP04.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 contentplacehol der 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.comwr ote in message
news:uO******** ********@TK2MSF TNGP04.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 contentplacehol der 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******** ********@TK2MSF TNGP03.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************* ***@TK2MSFTNGP0 4.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 contentplacehol der 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
1780
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 posting and editing news articles). I use masterpages so it needs to be able to publish content in the ContentPlaceholder server controls.
2
2467
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 and want to be able to populate the ContentPlaceholders of the inner-most masterpage at run-time.
5
4319
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 the best choise? 1) Using Masterpages with Themes (css / images / skins included in this theme)
2
8296
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 why this code does not function. As you can see if you compile it with 2005, clicking "Button" will achieve the desired result of displaying the contents of the textbox, however the test(); function called from Page_Load does not do anything. ...
4
3548
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, decrypts it, and sets up a Session variable holding the name of the MasterPage to use. The contents pages interrogate this Session variable in the Page_PreInit method (has to be done here) and apply the correct MasterPage accordingly. Works...
1
1660
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 = Profile.FullName; }
1
2343
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 from one to the other. 1. The postbackurl method doesn't seem to work with master pages. If I take away the master pages it works. 2. The server.transfer method also doesn't work if I try to acess the
6
1979
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 that on the main one I have a user control in the left side that has the site navigation menu while the login/logout masterpage has a non-breaking space in that table cell. Everything else is exactly the same. The issue is that the login/logout...
8
11792
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 manage. I have 300 lines of styles in my masterpage and I don't need all of this for every page -- somehow this can't be a smart way of managing styles. How do I programmatically apply styles in my MasterPage based on the ContentPlaceHolder...
0
9297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10069
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7285
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6556
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3828
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2697
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.