What is the use of place holder and can we use it as an pop up window

Dani AI

Generated

Short answer: yes — but do the popup on the client side. was right to suggest a DIV/Panel plus a bit of JavaScript, and is correct that a server-side PlaceHolder by itself doesn’t render visible markup you can hover. Render a DOM element (plain DIV or an asp:Panel) next to the image and toggle its visibility with CSS for desktops and a small script for touch devices.

A compact CSS-first pattern (works without JavaScript for mouse hover, with transition and keyboard focus):

<style>
.thumb { position: relative; display: inline-block; }
.thumb img { display:block; }
.popover {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 6px;
  background:#222; color:#fff; padding:8px; border-radius:4px;
  white-space:nowrap;
  opacity:0; transform:translateY(6px);
  transition:opacity .18s, transform .18s;
  pointer-events:none; z-index:999;
}
.thumb:hover .popover,
.thumb:focus-within .popover {
  opacity:1; transform:translateY(0); pointer-events:auto;
}
</style>

<div class="thumb" tabindex="0">
  <img src="..." alt="..." />
  <div class="popover" role="dialog" aria-hidden="true">Popup content</div>
</div>

For touch support (taps) add a small script that toggles a class or inline styles and sets aria-hidden. If using ASP.NET controls, give the panel a CssClass or set ClientIDMode="Static" so your script can find it reliably. If you must emit the popup from code-behind, render actual markup (an asp:Panel or Literal) rather than expecting PlaceHolder to produce visible HTML by itself.

Troubleshooting notes: watch parent overflow (it can clip the popup), set a high z-index and avoid pointer-events on hidden states, ensure keyboard access (tabindex/aria) because hover doesn’t work for keyboard-only users, and reattach event handlers after partial postbacks (UpdatePanel).

Recommended Answers

All 2 Replies

instead of placeholder you can think of panel control or much lighter html control div...

all you need is a little javascript and you are done..

in google you can search for hiding panels/div..

hope it helps.

PlaceHolder control serves as container to add controls dynamically to a web page at run time. The PlaceHolder control does not produce any visible output and is used only as a container for other controls on the Web page.

Therefore you cannot use it to show popup window.

You can use DIV to show a popup using CSS layers and javascript.

Try the following links.

How to Popup a Window Using DIV Layer in ASP.NET 1.x/2.x

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.