Blog Hero Image

Prüfen, ob sich ein Webpart im Design Modus befindet

This article dates back to 2009. Some of the tech in it is history by now; the article stays online as part of my archive.

AI training  ·  Current trainings

Prüfen, ob sich ein Webpart im Design Modus befindet

Während der Webpart Entwicklung kann es nützlich sein, zu wissen ob man sich gerade im Webpart Design Modus befindet. Folgender Codeausschnitt zeigt, wie man an diese Information kommt:

protected bool IsDesignMode()
{
    bool designMode = true; if (this.Page != null)
    {
        WebPartManager wp = WebPartManager.GetCurrentWebPartManager(this.Page); if (wp != null)
        {
            designMode = (wp.DisplayMode != WebPartManager.BrowseDisplayMode);
        }
    }
    return designMode;
}

Hilfreich ist dies zum Beispiel, um Validatoren während des Design Modus abzuschalten.

Inconsistent results with AI tools in your team?

I show developer teams how to turn Copilot, Claude, and Codex licenses into a reproducible development process. In one to two days, remote or in person in Bad Breisig, Germany.

To the AI training

I test the AI tools in real projects. You read what matters in five minutes.

What's changed in Claude Code, Copilot, and the other AI tools, and what it means for .NET teams. Plus news on .NET MAUI and the next book edition. No fixed schedule: I write when there's something worth your time. Unsubscribe anytime.

We send via Brevo. By subscribing you agree to your data being processed by Brevo.