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}:GroupRadioButton runat=server></{0}:GroupRadioButton>")
public class Test1 : RadioButton, IPostBackDataHandle
public GroupRadioButton() : 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(HtmlTextWriter output
RenderInputTag(output)
private void RenderInputTag(HtmlTextWriter htw
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")
els
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()
#endregio
#region IPostBackDataHandler Member
void IPostBackDataHandler.RaisePostDataChangedEvent(
OnCheckedChanged(EventArgs.Empty)
bool IPostBackDataHandler.LoadPostData(string postDataKey,
System.Collections.Specialized.NameValueCollection 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/