AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

eigenes WebControl - RadiobuttonList

Ein Thema von wabux · begonnen am 7. Mai 2006
Antwort Antwort
wabux

Registriert seit: 16. Jun 2005
6 Beiträge
 
#1

eigenes WebControl - RadiobuttonList

  Alt 7. Mai 2006, 22:47
Hallo,


ich brauche ein eigenes Webcontrol, ähnlich einer RadioButtonList. Aber ich blicke noch nicht wie ich die einzelnen Tags setzen kann.
Ausserdem würde es mich interessieren, wie man die Arrayliste deklariert, damit man am Propertygrid der Delphi-IDE die einzelnen Items eingeben kann.

so soll es mal aussehen
<input type="Radio" name='countrys,202' value="eu" >Europa

<input type="Radio" name='countrys,202' value="a" >Austria

<input type="Radio" name='countrys,202' value="b" >Belgium

<input type="Radio" name='countrys,202' value="ch" >Switzerland

<input type="Radio" name='countrys,202' value="hr" >Croatia

<input type="Radio" name='countrys,202' value="dk" >Denmark



Kann mir da bitte jemand helfen?

Danke


Delphi-Quellcode:
unit WebControl2;
interface
uses
  System.Web.UI,
  System.Web.UI.WebControls,
  System.ComponentModel,
  System.Collections,
  System.Drawing,
  Borland.Data.Web;

type
  /// <summary>
  /// Summary description for MyWebControl2.
  /// </summary>
  /// [ToolboxBitmap(typeof('PureWebControl.bmp'),'PureWebControl.bmp' )]
  ///
  [ControlBuilder(typeof(System.Web.UI.WebControls.PlaceHolderControlBuilder)),
  Designer('System.Web.UI.Design.ControlDesigner'),
  DefaultProperty('ID'),
  ToolboxData('<{0}:MyWebControl2 runat=server></{0}:MyWebControl2>')]
  MyWebControl2 = class(System.Web.UI.WebControls.WebControl, INamingContainer)
  strict private
    FText: String;
    FItems : arraylist ;

  strict protected
  // override RenderContents(..) when you inherit from Web.UI.WebControls.WebControl
    procedure RenderContents(Output: HtmlTextWriter); override;
    function GetDesignTimeHtml : string;

   // override Render(..) when you inherit from Web.UI.WebControls.Control
   // procedure Render(Output: HtmlTextWriter); override;
  public
    constructor Create;
  published
      [LocalizableCategoryAttribute('PureWeb'),
        DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
        DefaultValue('')]
    property Items: arraylist read FItems write FItems;

    [Bindable(false),
     Category('Appearance'),
     DefaultValue('')]
    property Text: string read FText write FText;
  end;

implementation

function MyWebControl2.GetDesignTimeHtml : string;
begin
  result := '<h1>Blog</h2><hr/><hr/>';
end;


/// <summary>
/// Define a public parameterless constructor needed by web controls.
/// </summary>
constructor MyWebControl2.Create;
begin
  inherited;
end;

/// <summary>
/// Render this control to the output parameter specified, preserving
/// cosmetic attribute output generation inherited from standard WebControl.
/// </summary>
/// <param name="output"> The HTML writer to write out to </param>
procedure MyWebControl2.RenderContents(Output: HtmlTextWriter);
begin
  Output.Write(Text);
end;

{$REGION 'Render override'}
(*
/// <summary>
/// Render this control to the output parameter specified.
/// </summary>
/// <param name="output"> The HTML writer to write out to </param>
procedure MyWebControl2.Render(Output: HtmlTextWriter);
begin
  Output.Write(Text);
end;
(* *)

{$ENDREGION}

end.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:48 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz