Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to add style dynamically in cs file and remove the border?

How to add style dynamically in cs file and remove the border?

Scheduled Pinned Locked Moved ASP.NET
javascripthelptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chakran
    wrote on last edited by
    #1

    Hi, I have added radion buttons dynamically using RadionButtonList control. am facing small problem. Radio buttons appears with line border. How to remove the border? below is the code I tried but no result. ListItem li = null; if (dvForDisplay.Count > 0) { rdb = new RadioButton(); rdl = new RadioButtonList(); panelRechargeOptions.Controls.Clear(); for (int i = 0; i < dvForDisplay.Count; i++) { li =new ListItem(); li.Value = dvForDisplay[i]["RadioButtonId"].ToString()+i.ToString(); li.Text = dvForDisplay[i]["RadioButtonText"].ToString(); li.Attributes.Add("onClick", "javascript:AmountToCharge('" + li.Text + "','" + strQuoteCurrency + "');"); li.Attributes.CssStyle.Value = BorderStyle.None.ToString(); rdl.Items.Add(li); rdl.RepeatDirection = RepeatDirection.Horizontal; rdl.Style.Add(HtmlTextWriterStyle.BorderWidth, "0px"); panelRechargeOptions.Controls.Add(rdl); } }

    M 1 Reply Last reply
    0
    • C chakran

      Hi, I have added radion buttons dynamically using RadionButtonList control. am facing small problem. Radio buttons appears with line border. How to remove the border? below is the code I tried but no result. ListItem li = null; if (dvForDisplay.Count > 0) { rdb = new RadioButton(); rdl = new RadioButtonList(); panelRechargeOptions.Controls.Clear(); for (int i = 0; i < dvForDisplay.Count; i++) { li =new ListItem(); li.Value = dvForDisplay[i]["RadioButtonId"].ToString()+i.ToString(); li.Text = dvForDisplay[i]["RadioButtonText"].ToString(); li.Attributes.Add("onClick", "javascript:AmountToCharge('" + li.Text + "','" + strQuoteCurrency + "');"); li.Attributes.CssStyle.Value = BorderStyle.None.ToString(); rdl.Items.Add(li); rdl.RepeatDirection = RepeatDirection.Horizontal; rdl.Style.Add(HtmlTextWriterStyle.BorderWidth, "0px"); panelRechargeOptions.Controls.Add(rdl); } }

      M Offline
      M Offline
      Member_3259094
      wrote on last edited by
      #2

      hi check this , i hope this will work li.Attributes.CssStyle.Add("border", "0");

      Rajeev Kr. Sharma VRI Software Pvt.Ltd. New Delhi India HumOnline.com Stay Connected

      C 1 Reply Last reply
      0
      • M Member_3259094

        hi check this , i hope this will work li.Attributes.CssStyle.Add("border", "0");

        Rajeev Kr. Sharma VRI Software Pvt.Ltd. New Delhi India HumOnline.com Stay Connected

        C Offline
        C Offline
        chakran
        wrote on last edited by
        #3

        hi Rajeev, its not working. Thanks, Chakri.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups