473,657 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ContentPlaceHol der default content issue

For some reason when I use asp controls for the default content of a
ContentPlaceHol der, they do not get rendered. Static content is rendered just
fine however! Specifically I'm using multiple <asp:Image> and <asp:HyperLin k>
controls and when I copy & paste them into a regular page, they work fine.
When I paste them into the Master page's ContentPlaceHol der, they do not
render. When I view the resulting page source, the controls are completely
missing, almost as if I had set the Visible property to false on all of them
(which of course, I am not doing).

Also worth noting, if I include any inline asp with my default content while
also using asp controls, I get the following runtime error:
Specified argument was out of the range of valid values. Parameter name: index
If I remove the controls from the ContentPlaceHol der, the inline code runs
fine!?

Here's the ContentPlaceHol der ASP.net code:
<asp:ContentPla ceHolder ID="cphHeader" runat="server" >
<%if (true) { string s = "some example code"; } %>
<asp:HyperLin k runat="server" ID="HyperLink1 "
NavigateUrl="~/default.aspx">
<asp:Image runat="server" ID="Image1"
ImageUrl="~/images/Logo.gif" ImageAlign="Abs Middle" />
</asp:HyperLink>
<asp:Image runat="server" ID="Image2"
ImageUrl="~/images/lock.gif" ImageAlign="Abs Middle" />

</asp:ContentPlac eHolder>

If I remove the inline asp code (line 2), I don’t get a runtime error
anymore, but none of the controls are rendered. If I move the controls
outside of the ContentPlaceHol der, they render fine!?

I am completely lost as to what is going on here. PLEASE help if you have
any ideas!!
Thanks.

-Nick
May 3 '06 #1
0 1584

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

Similar topics

3
9381
by: Fred Nelson | last post by:
I'm developing my first VS2005 C# web application. On my master page I have a "contentplaceholder" and it covers a small portion of the screen. I can place controls anywhere on the pages that use it however this "break" is annoying. Does anyone know how to resize the content place holder - I've tried everything (tables, drag&drop, etc.) Thanks very much!
4
3467
by: Greg | last post by:
How do I programmatically load an .aspx page into the contentplaceholder? Similar to what would happen in the "navigateURL" property when clicking on a hyperlink on the master page. . . ASP .NET 2.0 Thanks, Greg
2
1873
by: Andrew Robinson | last post by:
I would like to use a ContentPlaceHolder within the following. Any ideas on how to best accomplish this? <td rowspan="2" style="width: 600px; background-image: url('<asp:ContentPlaceHolder ID="ContentPlaceHolderRight" runat="server" />'); background-position: bottom right; background-repeat: no-repeat;"> I am thinking that I might have to use a set method off of the masterpage to set this but I would rather do it declaratively in my...
3
1549
by: =?Utf-8?B?TmFuY3lB?= | last post by:
Hi - We need to be able to invoke a child (contentplaceholder) page from a master page and have the child run some jscript code in the initialization event to load data specific to that child. We can't seem to find a way to do it. The page.load event seems to be limited to the master page. How can we do this on the child page? Thanks for any help.
3
14955
by: jobs | last post by:
Hello. I have a master page with ContentPlaceHolder under a html Div tag. That DIV tag has CSS that positions it. While in Visual Studio design view, that div tag and contentplace holder does not appear where it actually shows up when you run it the code. Is DIV the best way to go? How else can I do this? ContentPlaceHolder
1
1168
by: =?Utf-8?B?UGF1bA==?= | last post by:
I have a master page and a ContentPlaceHolder page in a typical master page imlpmentation. Does anyone know the property or method that I can use to retrieve the file path/location of the ContentPlaceHolder page?
1
2386
by: =?Utf-8?B?ampmbGFzaA==?= | last post by:
I have a master page with a contentplaceholder object. When creating content pages, I'm adding controls to the contentplaceholder area. The contentplaceholder is not stretching so that I can continue to edit or add control below the last object added. For instance, I have a table that I can only get to the top rows. The lower rows are not accessable because the bottom of the contentplaceholder overlaps the areas. Any thought?
1
1506
by: mil111 | last post by:
Hi, Can anybody help me? I created master page (in table) with header, footer, left column and in the right column is contentPlaceHolder. Content on contentPlaceHolder is longer than the left column is. If I run the page left column resizes according to content in contentPlaceHolder, and I don't want that. How I can set left column on fixed size so that only contentPlaceHolder resizes. I tried with <div> and <asp:panel> but it doesn't seems...
0
1052
by: Andy B | last post by:
I have a div on the master page that is 600px high. It has a left pannel, main content (contentPlaceHolder) inside another div and a footer. What I am looking for is a few things: 1. How do you use .net (VB) or javascript to make sure the browser sticks to 800x600? 2. Is it possible to set the "leftPannel" (a div element) to a certain size and put it on the screen in a certain place regardless of how much content is in the...
0
8323
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
8838
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...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
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
5638
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
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.