Modales Popup in ASP.NET

Ein modales Popup in ASP.NET zu erzeugen ist nicht schwer, aber umständlich. Leider! Hier eine kleine Anleitung:

Der erste Schritt ist ein Javascript zum Öffnen eines Popups:

function openPopup(url, title) {
width = 860;
height = 360;
posx = window.screenLeft + posx;
posy = window.screenTop + posy;

var Fenster;

if (window.showModalDialog){
var features = "dialogWidth:" + width + "px;dialogHeight:" + height +
"px;resizable:no;scroll:no;status:no;edge:sunken;help:no;center:yes";
Fenster = window.showModalDialog(url, title, features);
} else {
var features = "locationbar=no, directories=no, status=no, " +
"menubar=no, scrollbars=no, resizable=no, modal=yes, dependent=yes, width=" +
width + ",height=" + height + ",left=" + posx + ",top=" + posy;
Fenster = window.open( url, title, features);
Fenster.focus();
}
}

Damit die Inhalte des Popups auch korrekt angezeigt werden (werden sonst gecacht), muss das Page_Load des Popups angepasst werden:

protected void Page_Load(object sender, EventArgs e) {
if (!this.IsPostBack) {
Response.Expires = 0;
Response.Cache.SetNoStore();
Response.AppendHeader("Pragma", "no-cache");
}
}

Updated: