The Artima Developer Community
Sponsored Link

.NET Buzz Forum
ASP.NET: Web Controls dynamisch laden

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
-

Posts: 1524
Nickname: nitronic
Registered: Jul, 2006

Norbert Eder works as a software architect.
ASP.NET: Web Controls dynamisch laden Posted: Jun 27, 2007 2:41 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by -.
Original Post: ASP.NET: Web Controls dynamisch laden
Feed Title: Norbert Eder - Living .NET
Feed URL: http://feeds.feedburner.com/NorbertEder-Livingnet
Feed Description: Copyright (c)2005, 2006 by Norbert Eder
Latest .NET Buzz Posts
Latest .NET Buzz Posts by -
Latest Posts From Norbert Eder - Living .NET

Advertisement
In vielen Situationen ist es notwendig, Web Controls dynamisch in einen Platzhalter (Placeholder-Control) zu laden. Dies kann sehr einfach bewerkstelligt werden:
this.ContentPlaceHolder.Controls.Clear();
this.ContentPlaceHolder.Controls.Add
    (
    LoadControl("modules/TestControl.ascx")
    );

Das Beispiel geht davon aus, dass Web Controls im Verzeichnis modules gespeichert sind. Beim ContentPlaceHolder handelt es sich um ein ContentHolder-Control.

Natürlich kann dies auch entsprechend dynamischer gestaltet werden, da sich das zu ladende Control eventuell aus dem aufgerufenen Menüeintrag oder anderen Informationen definieren läßt.

Read: ASP.NET: Web Controls dynamisch laden

Topic: Visual Studio 2005: Refactoring-Performance verbessern Previous Topic   Next Topic Topic: Visual Studio 2005: Region-Blöcke per Tastatur auf- und zuklappen

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use