Monday 9 July 2012

FileUpload

FileUpload control is used to send a file to server from a client computer.

Some Commonly Used Properties of File Upload
FileBytes Property:
This property used to gets the array of bytes inwhich contents of the specified file is saved.
FileContent Property:
This is used to gets the stream object that points to a specified file uploaded by a fileupload control.
FileName Property:
This is used to gets the name of the file that is uploaded by the fileupload control.
HasFile Property:
This is used to check whether the fileupload control has a file or not.

Literal

Asp.net Literal control is used to display a static text on web page without adding any HTML element.You can display text programmatically with server side code.You can display your text static but literal control is used only when you need to you the contents in server side otherwise you can use simple html tags.Literal control is similar to Label control but the difference is that you cannot apply any style on literal control.

Sunday 8 July 2012

Panel

The asp.net panel control provides a container on small area within the web page inwhich we can use other controls.By adding controls into the panel we can handel them as a single unit for example hidding or showing them within web page.Simply asp.net panel control is used to create a distinct appearence for a group of controls within the panel control.

ImageButton

Image button is used to display a clickable image.We can set image on imagebutton by specifying the image path to ImageUrl property.

Some Commonly Used Properties For ImageButton

ImageUrl Property:
Gets the url of the image that is to be displayed on imagebutton.
AlternateText Property:
Gets or stes the alternate text that will be displayed when image cannot be shown or found.
ImageAlign Property:
ImageAlign property is to set the alignment of the image.
DescriptionUrl Property:
This property defines the url that contains the more detailed description of the image.
OnClientClick Property:
This property defines the client side script that will be executed on client side onclick.
Click Event:
This event fires when the image is clicked.

Saturday 7 July 2012

BulletedList

ASP.NET BulletedList control is used to create a list of items with bulleted format.You can set bulleted format as circle or rectangle and you can add items in bulleted list by using <asp:ListItem>.You can specify your bullet style by using BulleteStyle property.You can display your list of items in an organized or unorganized form.
How to Add Items Manually in BulletedLIst?
To add items manually in bulleted list, first double click on bulletedList control in toolbox.
After bulletedList is added into web page then click on the small tag on bulleted lis.then select Edit Items a new List Item Collection Editor box will appear.Now enter your item text that will appear in page and item's value.


How to Add Listitems programmatically?
You can add items programmatically by specifying the following at the server side.
At Client SIde:

    <asp:BulletedList ID="BulletedList1" runat="server">
        <asp:ListItem>Pakistan</asp:ListItem>
        <asp:ListItem>UK</asp:ListItem>
        <asp:ListItem>USA</asp:ListItem>
        <asp:ListItem>France</asp:ListItem>
    </asp:BulletedList>
At Server Side:
    protected void Page_Load(object sender, EventArgs e)
    {
        BulletedList1.Items.Add(new ListItem("Canada","Canada"));
        BulletedList1.Items.Add(new ListItem("Australia", "Australia"));
        BulletedList1.Items.Add(new ListItem("Russia", "Russian"));
        BulletedList1.Items.Add(new ListItem("Itly", "Itly"));
    }

How to display items from database?
To display list items from database simply provide the data source to the bulletedList control.To specify the data source to bulleted list first add you bulletedlist control into the web form and select it, a small tag will appear click on the small tag and select Choose Data Source option.
A new Data Source configuration wizard box.With the help of this box you can simply provide your data source.


How to specify bullets as Custom Image in BulletedList control?
You can specify the bullets as custom image in bulletedList by using the BulletIamageUrl property.
    <asp:BulletedList ID="BulletedList1" runat="server" 
        BulletImageUrl="~/bullet.png" BulletStyle="CustomImage" Width="71px">
        <asp:ListItem>Pakistan</asp:ListItem>
        <asp:ListItem>UK</asp:ListItem>
        <asp:ListItem>USA</asp:ListItem>
        <asp:ListItem>France</asp:ListItem>
    </asp:BulletedList>
How to display hyperlinks in BulledtedList control?
To display hyperlinks in bulleted list simply set DisplayMode is Hyperlink.
    <asp:BulletedList ID="BulletedList1" runat="server" 
        Width="71px" DisplayMode="LinkButton">
        <asp:ListItem Value="http://www.youtube.com/watch?v=gGiglVYd1b4">Pakistan</asp:ListItem>
        <asp:ListItem Value="http://www.youtube.com/watch?v=gGiglVYd1b4">UK</asp:ListItem>
        <asp:ListItem Value="http://www.youtube.com/watch?v=gGiglVYd1b4">USA</asp:ListItem>
        <asp:ListItem Value="http://www.youtube.com/watch?v=gGiglVYd1b4">France</asp:ListItem>
    </asp:BulletedList>
How to display LinkButton in BulledtedList control?
To display linkbutton in bullet list simpply set the Display property is linkButton.
   <asp:BulletedList ID="BulletedList1" runat="server" 
        Width="71px" DisplayMode="LinkButton">
        <asp:ListItem>Pakistan</asp:ListItem>
        <asp:ListItem>UK</asp:ListItem>
        <asp:ListItem>USA</asp:ListItem>
        <asp:ListItem>France</asp:ListItem>
    </asp:BulletedList>
 

Sunday 1 July 2012

ASP.NET Hidden Field

Hidden Field is used to keep information on a web page that is not to displayed on the client side user.Hidden field is normally used to keep state information of web page just like view state,session state and cookies are used to maintain state information but there are some places where these controls are not available then there we use a hidden field control.Note that we can access the value of hidden field control at client side that way we does not keep ant sensitive information in the hidden field.


<asp:HiddenField ID="HiddenField1" runat="server" />


Some Commonly Used Properties For Hidden Field
Value Property:
You can get or set value to hidden field.


ValueChanged Event:
This event fires when the value of the control changed.

ASP.NET Calender

Calendar control in asp.net is used to take a date as a input e.g. dob,hire date,birthday etc.
This control displays a full month at a time and you can select a single day or date from it.Similarly you can get single day,month,year,minutes,seconds and milliseconds etc.

Some Commonly Used Properties of Calendar
Caption Property:
This property set gets or sets the caption of the calendar control.
CaptionAlign Property:
This property gets or sets the alignment for caption of the calendar.
DaHeaderStyle Property:
This is used to gets the style properties for portion on the calendar that displays the day of the week.
DayNameFormat Property:
This is used to gets or sets the format of the day of the week.
DayStyle Property:
This is used to gets the style properties for the in displayed month.
FirstDayOfWeek Property:
This property define which day of week will be displayed in the first column of the calendar.
NextMonthText Property:
This is used to gets or sets the text of the next month navigation control.Usually it is >>.
NextPrevFormat Property:
This is used to gets or sets the format of the next ans previous month of the navigation control.
PrevMonthText Property:
This is used to gats or sets the text of the previous month navigation control.
SelectedDate Property:
This is used to gets or sets the selected date of the calendar.
SelectedDates Property:
This is used to gets or sets the list of selected dates.
SelectedDayStyle Property:
This is used to gets or sets the selected style properties of the date.
TodaysDate Property:
This is used to gets or sets the value for the today's date.

Some  Commonly Used Event For Calendar Control
SelectionChanged Event:
This event is raised when a single day,week or month is selected.
DayRender Event:
This event is raised when a single cell of the calendar is rendered.

Saturday 23 June 2012

ListBox

List box is used to display a list of one or more item so that user can choose one or more items from it.List box displays list of item sequentially and vertically in a scrollable window.

You can add values in Listbox manually or programmatically.To add values manually firstly add your listbox control into webpage and select it a small tag will appear on right side of listbox click on it and select Edit Items.
After click on Edit Items a ListItems Collection Editor box will appear .Click on Add button and enter your item's text in Text field and item's value in Value field.Your item will successfully added into listbox.Similarly you can add more values into listbox.At last click on OK button.
Similarly you can add values into listbox from database.To add values from database click on small tag of listbox and select Choose Data Source.A new Data Source Configuration Wizard dialog box will appear.Now create a new data source or select a already created data source.
After selection of Data Source click on OK button.
To add values in listbox programmatically use the following code in PageLoad event.

   
 protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            ListBox1.Items.Add(new ListItem("Pkistan", "Pkistan"));
            ListBox1.Items.Add(new ListItem("Canada", "Canada"));
            ListBox1.Items.Add(new ListItem("Paris", "Paris"));
            ListBox1.Items.Add(new ListItem("UK", "UK"));
            ListBox1.Items.Add(new ListItem("Itly", "Itly"));
        }
    }
This code add the values in the listbox at run time.


Some Commonly Used Properties of ListBox
SelectedIndex Property:
Gets or Sets the lowest index of the selected item in the listbox.This property will return the index as an integer.
SelectedItem Property:
Gets or Sets the selected item with the lowest index in the listbox control.
SelectedValue Property:
Gets the value of the selected item in the listbox control.This property will return the value as a string.
SelectionMode Property:
Sets the selection mode of the listbox control.By using this property you can select one or more values from the listbox.











Friday 22 June 2012

How To Add Class File in ASP.NET

To add a class file into asp.net follow these steps:
step 1:
           Open your asp.net project and goto solution explorer and right click on it and choose Add New Item->Class OR Add->Class
Step 2:
            Enter your class name and click on Add button.Your class.cs file will be added successfully.


           

How To Add a New WebForm in ASP.NET

In this tutorial we are going to discuss how to add a new webform in asp.net.We perform this task step by step.
Step 1:
            Firstly open your asp.net project and goto solution explorer and right click on asp.net project file Add->New Item OR simply you can use New Item short cut.
Step 2:
           A New Item dialog box will appear choose first item which is WebForm.aspx.
Step 3:
           Enter your web form name and click on Add button.Your new webForm will be successfully added into your asp.net project.





Tuesday 19 June 2012

Hyperlink

Hyperlink control is used to navigate to the target URL when user clicks on the link.Hyperlink control and LinkButton control looks similar but there is some difference between Hyperlink and LinkButton control in ASP.NET.When user clicks on a Hyperlink control the hyperlink control does not PostBack the page to the server.It will simply post the request to the server for the URL set in NavigateURL property.While LinkButton works like a simple button but it looks like a Hyperlink so LinkButton will PostBack the page to server.One other difference is that Hyperlink control does not have a OnClick event just like in LinkButton control.

Some Commonly Used Properties of Hyperlink Control
ImageURL Property:
This property is used to gets or sets the path to an image to display for the Hyperlink Control.
IsTrackingViewState Property:
This property is used to gets a value that indicates whether the server control is saving changes to its view state.It will return a simple boolean value which represents true or false.If returned value is true that mean the control is set to save view state while in case of false the control will not save the view state.
NavigateURL Property:
This property is used to gets or sets the URL to the link to when hyperlink control is clicked.

To see more properties click on link given below:

Thursday 14 June 2012

LinkButton

LinkButton is used to create a hyperlink in a website.This control looks like hyperlink but it has a same functionality of hyperlink control ans a button control.You can use the LinkButton control by specifying Text to display in linkbutton control by either the Text property or specifying the text between the opening tag and closing tag.
When you click on a linkbutton control then linkbutton take you to desired webpage by using PostBackUrl property e,g, PostBackUrl="~/how-to-use-textbox.aspx".

Some Commomly Used Properties
Access Key Property:
Access Key is used to get or set the access key so that you can easily navigate to web sever controls.In other words we can say that access key is use to create a short cut key 
to web server controls.
IsEnabled Proerty:
Gets a value that indicating whether the control is active or not.
OnClickClient Property:
Gets or Sets the client side script that executes when a LinkButton's click event raised.
<%@ page language="C#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void LinkButton1_Click (object sender, EventArgs e)
  {
    Label1.Text = "LinkButton is clicked.";
  }

</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="head1" runat="server">
    <title>LinkButton.OnClientClick Example</title>
</head>
<body>
  <form id="form1" runat="server">

    <h3>LinkButton.OnClientClick Example</h3> 
      <br />
      <h4>Click to navigate to Microsoft.com:</h4>     
      <br />
      <asp:linkbutton id="LinkButton1"
       text="Open Web site"
       onclientclick="Navigate()"
       onclick="LinkButton1_Click"
       runat="Server" />

       <br /><br />

      <asp:label id="Label1"
        runat="Server">
      </asp:label>
    </form>
    <script type="text/javascript">
      function Navigate()
      {
        javascript:window.open("http://www.microsoft.com");
      }    

    </script>
</body>
</html>

PostBackUrl Property:
The PostBackUrl property allows you to perform a cross-page post using the LinkButton control. Set the PostBackUrl property to the URL of the Web page to post to when the LinkButton control is clicked. For example, specifying Page2.aspx causes the page that contains the LinkButton control to post to Page2.aspx. If you do not specify a value for the PostBackUrl property, the page posts back to itself.


To see more properties of LinkButton control click following link:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.linkbutton.aspx

Tuesday 29 May 2012

DropDownList


DropDownList is used to create a drop-down list in which each item is defined by listitems.
DropDownList is used when you want to bound the user such that he can select an option from a list of options.
Each item in drop-down list is defined by ListItem element.Inother words we can say that each item is created by ListItem control in asp.net.For example:    
<asp:dropdownlist ID="Dropdownlist1" runat="server">
        <asp:ListItem>United States</asp:ListItem>
        <asp:ListItem>Germany</asp:ListItem>
        <asp:ListItem>Japan</asp:ListItem>
        <asp:ListItem>China</asp:ListItem>
        <asp:ListItem>Russia</asp:ListItem>
        <asp:ListItem>Pakistan</asp:ListItem>
        <asp:ListItem>India</asp:ListItem>
        <asp:ListItem>Australia</asp:ListItem>
        <asp:ListItem>London</asp:ListItem>
        <asp:ListItem>Canada</asp:ListItem>
</asp:dropdownlist>    
Here you can see DropDownList contains a ListItem control from which you can add your values.
How to Add Values Manually in DropDownLIst?
To manually add values in drop-down list you can use the previious code else follow this picture you can also add values graphically.


How to Add Values Programmatically in DropDownLIst?
If you want to set values to drop-down list at run time then you can use the following code at page load event or some other place wher you want.

protected void Page_Load(object sender, EventArgs e)
        {
            RadioButtonList1.Items.Add(new ListItem("C#","C#"));
            RadioButtonList1.Items.Add(new ListItem("VB","VB"));
            RadioButtonList1.Items.Add(new ListItem("J#","J#"));
            RadioButtonList1.Items.Add(new ListItem("C++", "C++"));
        }



How to Add Values in DropDownLIst from Database?
if you want to get values from database and show them in drop-down list then use the following pocedure.
First of all place your DropDownList control into web form.After placing the control a small tag will appear with the control click on it.Then two options will appear select or click Choose Data Source.


if your data source already exists then select it else create a new data source.


Some Commonly Used Properties of DropDownList
Selected Value Property:
If you to get a selected value from the drop-down list then you will you the SelectedValue property.This property returns the string value of the selected item in drop-down list.
Label1.Text =  DropDownList.SelectedValue;


Selected Index Property:
SelectedIndex property is used to Gets or Sets the index of the selected item.This property returns the index value as integer;
int a = DropDownList.SelectedIndex;


Selected Item Property:
Selected Item property is used to gets the selected item with the lowest index in the list control.


To see more properties use the following link:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist_properties.aspx





Friday 25 May 2012

RadioButtonList

RadioButtonList is an ASP.NET control which is used to provide a list of radiobuttons for a input from the user.The user can check only a single option from a multiple options provides by the RadionButtonList.RadionButtonList is similar to RadioButton control but the difference is that you can add individual RadioButton controls to a page and work with them singly.In simple words you group two or many individual buttons  together.On the otherhand RadioButtonList control a single control that treate as a parent control for a collection of radio button list items.RadioButtonlist control derived from a base ListControl Class and therefore it works like a ListBoxx,DropDownList and CheckBoxList controls.


How to Add RadioButton options Manully?
To add an Radio Button options manully follow first Add RadioButtonList control into your page.When you add a control into your page then a small tag will appear with the tag, click on it.


After click following picture will appear then click on Edit Items then a List Collection Editor box will appear.By clicking on Add button you can add a new option by specifying by setting the Text and Value properties.

How to Add Radio Button options Programmatically?
To add a ListItem into RadioButtonList, firstly you add a RadioButtonList control into your page then goto code behind file by pressing F7.At page_Load event write down the following code.


        protected void Page_Load(object sender, EventArgs e)
        {
            RadioButtonList1.Items.Add(new ListItem("C#","C#"));
            RadioButtonList1.Items.Add(new ListItem("VB","VB"));
            RadioButtonList1.Items.Add(new ListItem("J#","J#"));
            RadioButtonList1.Items.Add(new ListItem("C++", "C++"));
        }


How To a Bind RadioButtonList control to Database?
We can bind a RadioButtonList control to a Database by providing sqlDataSource.

Saturday 19 May 2012

CheckBoxList

Checkboxlist is used to provide a list of checkboxes that can be created dynamically by binding it to the data source.Checkbox is used to select a single value while checkboxlist is used to get a group of information from the user.
How t Bind a Checkboxlist to Datasource:

To bind a checkboxlist to datasource first add the checkboxlist control into your page.When the checkboxlist control is added to your page then a smart tag appears which allows you to specify a datasource or add a items manually to the checkboxlist.Also click on Edit Items to open the ListItem collection editor and add items as shown infigure below:



How to Add items Programmatically in CheckBoxLIst:
If you want to add items to checkboxlist programmatically, use the following code.

protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            cblMulti.Items.Add(new ListItem("Items 1""Items 1"));
            cblMulti.Items.Add(new ListItem("Items 2""Items 2"));
            cblMulti.Items.Add(new ListItem("Items 3""Items 3"));
        }
    }
Here in the code cblmulti.Items.Add take the augument of New ListItem whereas ListItem takes two argument first is Text and Second is Value.

Sunday 13 May 2012

Button

Asp.Net Button is used to submit information to the server.By default asp.net button is a Submit Button.When the user click on button then the button post back the web page to the server.To include as.net button in your project goto toolbox and double click on Button control.


  <asp:Button ID="Button1" runat="server" Text="Button" /> 


Some Useful Properties of Asp.Net Button
Access Key Property:
Gets or Sets the access key that allows you to quickly navigate to web server control.The default value of access key is Empty which shows that this property is not set.AccessKey is used to specify the keyboard shortcut for the web server control.This allow you to access the control quickly and easily by pressing the ALT key and that key you specified on the keyboard.For example, setting the access key of a control to the string "B" shows that the user can navigate to the control by pressing ALT+B.
Remember that only a single character is allowed for the access key.If you set access key to the value that is neither null, Empty nor a single character then the exception will be thrown.


<asp:Button id="button1" accessKey="B" />


ClientID Property:
Gets the control ID for HTML markup that is generated by Asp.Net. When the web server control is rendered as an HTML element then id attribute of HTML element is set to the value of ClientID property then the clientID property is used accesscthe HTML element at client side scripting by using document.getElementById  method.


ClientIDMode Property: 
Gets or Sets the algorithm that is used to generate the value of ClientID property.Asp.Net provides several algorithms to define how to generate the value of clientID property.The possible values are AutoID,Static,Predictable and Inherit.


CommandName Property:
Gets or Sets the Command name associated with Button control that is passed to the Command Event.
When you have a many button controls on your web page then use the CommandName property to find out the command name associated with each button control.You can set the any string with CommandName property that identifies the command toperform then by programmatically you can get the command name of button control and perform action.
For example:

void CommandBtn_Click(Object sender, CommandEventArgs e) 
{


switch(e.CommandName)
         {

            case "Asceding":

               // Call the method to sort the list in ascending order.
               Sort_List((String)e.CommandArgument);
               break;

            case "descending":
              //Call the method to sort the list in descending order.
              Sort_List((String)e.CommandArgument);  
break; default: // The command name is not recognized. Display an error message. Message.Text = "Command name not recogized."; break; }

}


Enabled Property:
Gets or Sets the the value indicating whether the web server control is enabled.


ID Property:
Gets or Sets the identifier to the web server control.


OnClientClick Property:
Gets or sets the client-side script that executes when a Button control's click event is raised.


PostBackUrl Property:
Gets or sets the URL of the page to post to from the current page when the Button control is clicked.


TabIndex Property:


Gets or Sets the tab index of the web server control.


Text Property:


Gets or Sets the text to be displayed on the button control.


ToolTip Prpperty:


Gets or Sets the text to be displayed when the mouse pointer hover over the web server control.


Some Useful Methods of Button



DataBind() Method:


Binds a data source to the invoked server control and all its child controls. 


Dispose() Method:


Enables a server control to perform final clean up before it is released from memory.


GetPostBackOption() Methid:


This method creates an object of PostBackOptions that shows the postback behaviour of button control.The PostBackOptions object is then passed to the ClientScriptManager.GetPostBackEventReference(PostBackOptions) method, which obtain a reference to a client-side script function that, when invoked, causes the server to post back to the page.You can override the GetPostBackOptions method in your derived class to modify the postback options for the button control.


OnClick() Method:


Callls the Click event of button control.


OnCommand() Method:


Calls the command event of button control.


OnDataBinding() Method:


Calls the DataBinding event of button control.


OnInit() Method:


Calls the Init event.


OnLOad() Method:


Calls the Load event.


OnUnload() Method:


Calls the unload event.


OpenFile() Method:


Gets a stream as a argument to read a file.


Some Useful Events of Button


Click Event:


Fires when button control is clicked.


Command Event:


Fires when button control is clicked.


DataBinding Event:


Fires when the server controls binds to a data source.


Init Event:


Occurs when server control is initialized.

Saturday 12 May 2012

Radio Button

Radio buttons are used when there is a list of two or more item that are mutually exclusive and the user need to select exactly one item. By using radio buttons, clicking a non-selected radio button will deselect whatever other radio button was previously selected in the list of items.To add a radio button into your project goto toolbox and double click on RadioButtons.
For example:

<asp:RadioButton ID="RadioButton1" runat="server" Text= "Radiobutton" Checked="true"/>




Some Useful Properties of Radio Buttons

ID Property:
Radiobutton.ID property id used to set the ID of  Radio button control.


protected void Page_Load(object sender, System.EventArgs e)
{
   // Set a ID to a Radiobutton
    Radiobutton.ID = "chkUserName";
}

Text Property:
We can set a value to  Radiobutton by using   Radiobutton.Text  property.For example


protected void Page_Load(object sender, System.EventArgs e)
{
   // set a text to Radiobutton
     Radiobutton1.Text = "Male";
    Radiobutton2.Text = "Female";
}

Enabled Property:
Radiobutton.Enabled property enable the state of   Radiobutton control..Initially its value is  true.

protected void Button1_Click(object sender, System.EventArgs e)
{
     Radiobutton.Enabled = false;
}

Visible Property:


Radiobutton.Visible property is used to set the visiblity of a  Radiobutton.If its value is true then  Radiobutton will be visible otherwise it will be hide for user.


protected void Button1_Click(object sender, System.EventArgs e)
{
   Radiobutton1.Visible = false;
}

Height & Width Property:
You can use the Height property along with the Width property  to size an object to specific dimensions.


protected void Button1_Click(object sender, System.EventArgs e)
{
     Radiobutton.Height = 100px;
     Radiobutton.Width = 100px;
}


CssClass Property:
You can use the CssClass property to specify the CSS(Cascadding Style Sheet) class to render on the client for the Web Server control. This property will render on browsers for all controls. In simple words you can add CssClass  by using CssClass property by just giving a cssclass name.

<asp:RadioButton ID="checkbox1" runat="server" Text="Subjects"  CssClass="HomePage"></asp:RadioButton>


Some Useful Events of RadioButton


Init Event:
This event fires when the page has been initialized.During page initialization, controls on the page are accessible and each control's UniqueID property is set. A master page and themes are also applied to the page if required. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.


protected void  RadioButton_Init(object sender, EventArgs e)
{
   Here you can write your logic...
}

Load Event:

This event fires when the web page has been loaded.During load, the opposite happens to the Init Event, all the postback data has been set and all the controls are ready and can fire their different events. The top container, the content page loads first as it can change the master page and user controls, then the master page and in the end the leaf controls.

protected void  RadioButton _Load(object sender, System.EventArgs e)
{
   Here You can write your code.
}


CheckedChanged Event:
This event occurs when the user changed the checked property of the control.

Some Useful Methods of RadioButton

Focus Method:

How to Set Focus on Asp.Net  ?

Radiobutton.Focus() method is use to set the control on a  Radiobutton.Focus method is helpful to reduce the use of mouse and user can easily get a control by using keyboard.


AT Server Side : 

protected void Page_Load(object sender, EventArgs e)
{
   Radiobutton.Focus();
}


At Client Side:

<%@ Page Language="C#" %>
<html>
<head runat="server">
  <title>Test Page</title>
</head>
<body>
  <form id="form1" runat="server" defaultfocus="TextBox1" >
    <div>
      <asp: Radiobutton  ID="Checkbox1" runat="server"></asp:Radiobutton>
      <br />
      <asp:Button ID="Button1" runat="server" Text="Button" />
      <br />
    </div>
  </form>
</body>
</html>


Databind() Method:
Radiobutton.Databind() binds the datasource to the invoked server control and all its child       controls.


Dispose() Method:
Checkbox.Dispose()  enables a server control to perform a final cleanup before it is released from memory.


To see more properties of Radiobutton click the link given below.
http://msdn.microsoft.com/en-us/library/system.windows.forms.radiobutton_properties.aspx