Question

#control {
position: absolute;
right: 0px;
top: 0px;
}
Was it helpful?

Solution

You cannot. That's because ContentPlaceHolder does not render to anything on a page.

You can however wrap a div around it and then apply the styles to it:

<div class="control">
    <asp:ContentPlaceHolder runat="server" ID="Content" />
</div>

OTHER TIPS

If your intension is to render out a div-element I would suggest that you used the Panel-control instead. You can still add/remove child Controls if you'd like (as with the ContentPlaceHolder).

// In your CSS
.control { position: absolute 0px 0px; }

// In your form
<asp:Panel ID="pnl" Runat="server" CssClass="control" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top