Ejemplo n.º 1
0
 //- #OnPreRender -//
 protected override void OnPreRender(EventArgs e)
 {
     String uniqueIdContainer = UniqueIDContainer;
     String id = String.Empty;
     if (String.IsNullOrEmpty(uniqueIdContainer))
     {
         id = GroupName;
     }
     else
     {
         id = uniqueIdContainer + "$" + GroupName;
     }
     if (Visibility != Visibility.ServerHidden)
     {
         Container container = new Container();
         Controls.Add(container);
         String clientHiddenAttribute = String.Empty;
         if (!String.IsNullOrEmpty(Label))
         {
             Label label = new Label
             {
                 AssociatedControl = this,
                 Text = Label
             };
             container.Controls.Add(label);
         }
         else
         {
             clientHiddenAttribute = ClientHiddenAttribute;
         }
         if (ValueEqualsLabel)
         {
             Value = Label;
         }
         container.Controls.Add(new System.Web.UI.WebControls.Literal
         {
             Text = String.Format("<input name=\"{0}\" id=\"{1}\" type=\"radio\" value=\"{2}\" {3} {4} />", id, ClientID, Value, Selected ? " checked=\"checked\"" : String.Empty, clientHiddenAttribute)
         });
         if (Visibility == Visibility.ClientHidden && !String.IsNullOrEmpty(Label))
         {
             container.ContainerType = ContainerType.Div;
             container.QuickAttributeName1 = "style";
             container.QuickAttributeValue1 = "display:none";
         }
     }
     //+ state
     if (!Form.SurpressState && Http.Method == HttpVerbs.Get)
     {
         StateTracker.Set(StateEntryType.ControlId, GroupName, id);
     }
     //+
     base.OnPreRender(e);
 }
Ejemplo n.º 2
0
 //- #OnPreRender -//
 protected override void OnPreRender(EventArgs e)
 {
     if (Visibility != Visibility.ServerHidden)
     {
         Container container = new Container();
         Controls.Add(container);
         String clientHiddenAttribute = String.Empty;
         if (!String.IsNullOrEmpty(Label))
         {
             Label label = new Label
             {
                 AssociatedControl = this,
                 Text = Label
             };
             container.Controls.Add(label);
         }
         else
         {
             clientHiddenAttribute = ClientHiddenAttribute;
         }
         container.Controls.Add(new System.Web.UI.WebControls.Literal
         {
             Text = String.Format("<input name=\"{0}\" id=\"{1}\" value=\"{2}\" {3} />", UniqueID, ClientID, Text, clientHiddenAttribute)
         });
         if (Visibility == Visibility.ClientHidden && !String.IsNullOrEmpty(Label))
         {
             container.ContainerType = ContainerType.Div;
             container.QuickAttributeName1 = "style";
             container.QuickAttributeValue1 = "display:none";
         }
     }
     //+ state
     if (!Form.SurpressState && Http.Method == HttpVerbs.Get)
     {
         StateTracker.Set(StateEntryType.ControlId, ID, UniqueID);
     }
     //+
     base.OnPreRender(e);
 }