Bonjour, je dois hériter d'un dropdownlist pour pouvoir y ajouter une proprieté texte. J'ai utilisé ce code :
Le dropDown list s'affiche bien en disign et execution mais je ne peux pas ajouter d'items... En disign ou en execution lorsque j'ajoute des itemps ils sont bien présent dans la collection mais ne sont pas affichés dans la page.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace GACControls { [System.Drawing.ToolboxBitmap(@"c:\b.bmp")] [DefaultProperty("Text")] [ToolboxData("<{0}:GACDropDownList runat=server></{0}:WebCustomControl1>")] public class GACDropDownList : System.Web.UI.WebControls.DropDownList { [Bindable(true)] [Category("GAC")] [DefaultValue("")] [Localizable(true)] public string GACAutorisation { get { String s = (String)ViewState["GACBind"]; return ((s == null) ? String.Empty : s); } set { ViewState["GACBind"] = value; } } protected override void RenderContents(HtmlTextWriter output) { output.Write(Text); } protected override void Render(HtmlTextWriter writer) { base.Render(writer); } } }
Problème de render?
Partager