Thanks for the reply. Its amazing ,this code works on C#. I don't know VB.NET and C# both are using same CLR. The code of C# belo
-----------------------------------------------------------
[ToolboxData("<{ 0}:GroupRadioBu tton runat=server></{0}:GroupRadioB utton>")
public class Test1 : RadioButton, IPostBackDataHa ndle
public GroupRadioButto n() : base(
#region Propertie
private string Valu
ge
string val = Attributes["value"]
if(val == null
val = UniqueID
els
val = UniqueID + "_" + val
return val
#endregio
#region Renderin
protected override void Render(HtmlText Writer output
RenderInputTag( output)
private void RenderInputTag( HtmlTextWriter htw
htw.AddAttribut e(HtmlTextWrite rAttribute.Id, ClientID)
htw.AddAttribut e(HtmlTextWrite rAttribute.Type , "radio")
htw.AddAttribut e(HtmlTextWrite rAttribute.Name , GroupName)
htw.AddAttribut e(HtmlTextWrite rAttribute.Valu e, Value)
if(Checked
htw.AddAttribut e(HtmlTextWrite rAttribute.Chec ked, "checked")
if(!Enabled
htw.AddAttribut e(HtmlTextWrite rAttribute.Disa bled, "disabled")
string onClick = Attributes["onclick"]
if(AutoPostBack
if(onClick != null
onClick = String.Empty
onClick += Page.GetPostBac kClientEvent(th is, String.Empty)
htw.AddAttribut e(HtmlTextWrite rAttribute.Oncl ick, onClick)
htw.AddAttribut e("language", "javascript ")
els
if(onClick != null
htw.AddAttribut e(HtmlTextWrite rAttribute.Oncl ick, onClick)
if(AccessKey.Le ngth > 0
htw.AddAttribut e(HtmlTextWrite rAttribute.Acce sskey, AccessKey)
if(TabIndex != 0
htw.AddAttribut e(HtmlTextWrite rAttribute.Tabi ndex,
TabIndex.ToStri ng(NumberFormat Info.InvariantI nfo))
htw.RenderBegin Tag(HtmlTextWri terTag.Input)
htw.RenderEndTa g()
#endregio
#region IPostBackDataHa ndler Member
void IPostBackDataHa ndler.RaisePost DataChangedEven t(
OnCheckedChange d(EventArgs.Emp ty)
bool IPostBackDataHa ndler.LoadPostD ata(string postDataKey,
System.Collecti ons.Specialized .NameValueColle ction postCollection
bool result = false
string value = postCollection[GroupName]
if((value != null) && (value == Value)
if(!Checked
Checked = true
result = true
els
if(Checked
Checked = false
return result
#endregio
}
---
Posted using Wimdows.net Newsgroups -
http://www.wimdows.net/newsgroups/