Hi Udayams,
This is sample snippet to create radio button which is used in our project,
take it as reference
StringWriter stringWriter = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(stringWriter);
htw.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
htw.AddAttribute(HtmlTextWriterAttribute.Type, "radio");
htw.AddAttribute(HtmlTextWriterAttribute.Name, GroupName);
htw.AddAttribute(HtmlTextWriterAttribute.Value, Value);
if (Checked)
htw.AddAttribute(HtmlTextWriterAttribute.Checked, "checked");
if (!Enabled)
htw.AddAttribute(HtmlTextWriterAttribute.Disabled, "disabled");
string onClick = Attributes["onclick"];
if (AutoPostBack)
{
if (onClick != null)
onClick = String.Empty;
onClick += Page.GetPostBackClientEvent(this, String.Empty);
htw.AddAttribute(HtmlTextWriterAttribute.Onclick, onClick);
htw.AddAttribute("language", "javascript");
}
else
{
if (onClick != null)
htw.AddAttribute(HtmlTextWriterAttribute.Onclick, onClick);
}
if (AccessKey.Length > 0)
htw.AddAttribute(HtmlTextWriterAttribute.Accesskey, AccessKey);
if (TabIndex != 0)
htw.AddAttribute(HtmlTextWriterAttribute.Tabindex,
TabIndex.ToString(NumberFormatInfo.InvariantInfo));
htw.RenderBeginTag(HtmlTextWriterTag.Input);
htw.RenderEndTag();
Other than code, you can go for this
link[
^] for more reference.
Hope this helps you a bit.
Regards,
RK