c# - How to add same behaviour to a usercontrol template as the gridview <Columns> -
ASP Gridwu tag When defining markup for column , one can only choose from a Is the predefined set of controls (ASP: Boundfield, ASP: Buttonfield etc.)
I'm curious about whether I can add the same type of behavior, say that limiting content into custom control properties for a TemplateContainer defined in a standard user control "text "And" ImageUrl "and then handle the rendering of each element within the container from the code anyway?
OK, in the end I resolved it, which means that I can do the following
< code> & lt;% @ register src = "~ / controls / core / context menu" Askks "tagname =" Kantaksmenu "Tagprfiks =" UK "% & gt; & Lt;% @ register assembly =" Apakod "namespace =" Corner. Control. Contaks menu "Tagprfiks =" cc "% & gt; & Lt; uc: ContextMenu id =" ContextMenuMain "runat =" server "& gt; & LT; before & gt; & Lt; cc: ContextMenuItem text =" new "ImageUrl = "..." / & gt; & Lt; cc: ContextMenuItem text = "Save" ImageUrl = "..." / & gt; & Lt; / item & gt; & Lt; / UC: ContextMenu & gt;
where each reference Menuitm app is a custom class code, note that I have to register app_code assembly to identify the class markup. indicates the location of the namespace class Uses The code behind the subject we add it:
private List & lt; ContextMenuItem & gt; item = new List & lt; ContextMenuItem & gt; (); [Sthayitvmod (Sthayitvmodkinrproprti ), Dijhainrsiriyalaijeshn visibility (Dijhainrsiriyalaijeshn Visbilitikcontent)] public list & lt; ContextMenuItem & gt; before you get (if (item == null) {item = new list & lt; ContextMenuItem & gt; ({);} return the goods Do;} set {items = value;}}
at the time of user rendering Can be processed :)
Comments
Post a Comment